Bug 49579

Summary: [PATCH]UnknowEscherRecord throws ArrayIndexOutOfBoundException
Product: POI Reporter: Zhang Zhang <zhangzzh>
Component: HSLFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: File that has this exception
Test code
Suggested patch
Patch for UnknowEscherRecord with Unit test case

Description Zhang Zhang 2010-07-09 17:55:43 UTC
For some PPT files, UnknowEscherRecord throws ArrayIndexOutOfBoundException at line 62 at a System.arraycopy.
The bytesRemaining variable became really big for some files, so I guess it need a check to compare the bytesRemaining with the avaliabe bytes in data array.
Comment 1 Zhang Zhang 2010-07-09 17:57:15 UTC
Created attachment 25738 [details]
File that has this exception

This file has the ArrayOutOfBoundExceptioin, but it can be open by Office 2007 without problem.
Comment 2 Zhang Zhang 2010-07-09 17:58:15 UTC
Created attachment 25739 [details]
Test code

Test Java code to create a HSLFSlideShow instance and got the exception
Comment 3 Zhang Zhang 2010-07-09 18:14:20 UTC
Created attachment 25740 [details]
Suggested patch

Attached a suggest patch, if ok, I will open a new bug for check in.
Comment 4 Zhang Zhang 2010-07-16 18:08:44 UTC
Created attachment 25776 [details]
Patch for UnknowEscherRecord with Unit test case

Fix for the issue in UnknowEscherRecord with unit test cases.
Comment 5 Yegor Kozlov 2010-07-27 11:26:06 UTC
Applied in r979747