https://issues.apache.org/bugzilla/show_bug.cgi?id=51902
Bug #: 51902
Summary: [PATCH] Picture.fillRawImageContent -
ArrayIndexOutOfBoundsException
Product: POI
Version: 3.8-dev
Platform: PC
Status: NEW
Severity: major
Priority: P2
Component: HWPF
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Created attachment 27617
--> https://issues.apache.org/bugzilla/attachment.cgi?id=27617
Patch for issue
Found a handful of Word files that cause ArrayIndexOOB. (Unable to attach
sample due to sensitive nature of files).
Patch included, essentially the pictureBytesStartOffset used for a
System.arraycopy() is sometimes set to a negative value.
Fix uses an existing less-than check but also makes sure it's greater than zero
before using the new value rather than the default PICTF1BlockOffset.
Stack Trace: (POI-3.8-beta4)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.poi.hwpf.usermodel.Picture.fillRawImageContent(Picture.java:363)
at org.apache.poi.hwpf.usermodel.Picture.getRawContent(Picture.java:203)
at org.apache.poi.hwpf.usermodel.Picture.fillImageContent(Picture.java:372)
at org.apache.poi.hwpf.usermodel.Picture.getContent(Picture.java:191)
at
org.apache.poi.hwpf.usermodel.Picture.suggestPictureType(Picture.java:330)
at
org.apache.poi.hwpf.usermodel.Picture.suggestFileExtension(Picture.java:315)
at
org.apache.poi.hwpf.usermodel.Picture.suggestFullFileName(Picture.java:150)
at
org.apache.tika.parser.microsoft.WordExtractor$PicturesSource.<init>(WordExtractor.java:504)
at
org.apache.tika.parser.microsoft.WordExtractor$PicturesSource.<init>(WordExtractor.java:488)
at
org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:81)
at
org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:196)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
... 45 more
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]