The HLSFSlideShow.readPictures() method can result in an infinite loop. When trying to instantiate an PowerPointExtractor with poi-scratchpad-3.0-alpha3-20061212.jar the following exception was raised. Problem reading picture: java.lang.IllegalArgumentException: Unsupported picture type: -61464 You document will probably become corrupted if you save it! While debugging i noticed that POI was trying to read pictures out of a PPT presentation, unfortunately at least one picture was of size 0 (don't know why). That made the method HSLFSlideShow.readPictures() ran into an infinite loop at line 283 at pos += imgsize; because imgsize was zero.
Could you attach the ppt file? Without it it is impossible to debug the problem. Yegor
It shouldn't be able to get into an infinite loop, as the code always winds on by the size of the header block (8 bytes) I've added a check to ensure the img size is positive, since a negative one could lead to an infinite loop. Can you re-open the bug if this doesn't help, and upload the problem document?
Created attachment 19401 [details] The ppt presentation Unfortunately that change didn't help. I attached the problematic ppt file.
Ah, I was being bitten by java's garbage collection not playing nicely with loops of the kind we're using I've shifted the byte array creation until after we've decided we have a real picture. That fixes the memory exception for me. (I've also added a test to the suite, using your sample doc, to check it stays fixed)