Bug 49314 - Crash when opening Microsoft EXCEL workbook in Windows7
Summary: Crash when opening Microsoft EXCEL workbook in Windows7
Status: RESOLVED DUPLICATE of bug 49315
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 04:40 UTC by Chris Plastow
Modified: 2010-05-22 07:15 UTC (History)
0 users



Attachments
Excel file that causes the crash (10.00 KB, application/vnd.ms-excel)
2010-05-20 04:40 UTC, Chris Plastow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Plastow 2010-05-20 04:40:12 UTC
Created attachment 25460 [details]
Excel file that causes the crash

Hi,

Opened the attached workbook using the following code:

    public static Workbook openWorkbook(Resource res)
        throws IOException, InvalidFormatException
    {
        InputStream in = null;
        try {
            in = res.openInputStream(task);
            return WorkbookFactory.create(in);
        } finally {
            if (in != null) try {in.close();} catch (IOException e) {}
        }
    }

The line: WorkbookFactory.create(in); produced the following exception:

org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0xFF left 2 bytes remaining still to be read.
	at org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:155)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:216)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:392)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:276)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:60)
Comment 1 Yegor Kozlov 2010-05-22 07:15:19 UTC

*** This bug has been marked as a duplicate of bug 49315 ***