Bug 41384 - Array index wrong in record creation
Summary: Array index wrong in record creation
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: unspecified
Hardware: Other Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2007-01-16 10:24 UTC by Tales Paiva
Modified: 2007-03-21 07:06 UTC (History)
0 users

File for testing (190.50 KB, application/vnd.ms-powerpoint)
2007-01-16 10:26 UTC, Tales Paiva

Note You need to log in before you can comment on or make changes to this bug.
Description Tales Paiva 2007-01-16 10:24:34 UTC
When I call 

SlideShow ppt = new SlideShow(new HSLFSlideShow(args[0]));

In the org.apache.poi.hslf.extractor.ImageExtractor.java, an
ArrayIndexOutOfBoundsException occurs, here is the stack trace:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -402645242
	at org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
	at org.apache.poi.util.LittleEndian.getUShort(LittleEndian.java:64)
	at org.apache.poi.hslf.record.Record.findChildRecords(Record.java:112)
	at org.apache.poi.hslf.HSLFSlideShow.buildRecords(HSLFSlideShow.java:217)
	at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:126)
	at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:95)
	at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:82)
	at org.apache.poi.hslf.extractor.ImageExtractor.main(ImageExtractor.java:40)

In some debug observations, I notice that: in the records creation, when the
position is 2703, a record with type 4085 (UserEditAtom) is created. From this
point, all the subsequent records are created with type 0 (zero). At some point,
the getUShort parameter passed is wrong. This is what I observed, don't know if
it will help.

I don't know how to reproduce the bug again. I'll upload the file.
Comment 1 Tales Paiva 2007-01-16 10:26:54 UTC
Created attachment 19415 [details]
File for testing
Comment 2 Yegor Kozlov 2007-03-21 07:06:45 UTC

Tales, thank  you for reporting it.