Bug 49314

Summary: Crash when opening Microsoft EXCEL workbook in Windows7
Product: POI Reporter: Chris Plastow <chris>
Component: XSSFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.6-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: other   
Attachments: Excel file that causes the crash

Description Chris Plastow 2010-05-20 04:40:12 UTC
Created attachment 25460 [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:19 UTC

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