Bug 49315 - Crash when opening Microsoft EXCEL workbook in Windows7
Summary: Crash when opening Microsoft EXCEL workbook in Windows7
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
: 49314 (view as bug list)
Depends on:
Reported: 2010-05-20 04:40 UTC by Chris Plastow
Modified: 2015-06-01 19:50 UTC (History)
0 users

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

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 25459 [details]
Excel file that causes the crash


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:20 UTC
*** Bug 49314 has been marked as a duplicate of this bug. ***