Patch from bug #51566 - HSLF fix for finishing parsing the picture stream on the first non-valid type

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1183654 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2011-10-15 14:43:00 +00:00
parent d71f80e6a1
commit ecad01a716
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta5" date="2011-??-??">
<action dev="poi-developers" type="fix">51566 - HSLF fix for finishing parsing the picture stream on the first non-valid type</action>
<action dev="poi-developers" type="fix">51974 - Avoid HWPF issue when identifying the picture type</action>
<action dev="poi-developers" type="fix">52035 - Fix signed issue with very large word 6 files</action>
<action dev="poi-developers" type="fix">51949 - Avoid NPE on double close of ZipFileZipEntrySource</action>

View File

@ -355,6 +355,11 @@ public final class HSLFSlideShow extends POIDocument {
int imgsize = LittleEndian.getInt(pictstream, pos);
pos += LittleEndian.INT_SIZE;
// When parsing the BStoreDelay stream, [MS-ODRAW] says that we
// should terminate if the type isn't 0xf007 or 0xf018->0xf117
if (!((type == 0xf007) || (type >= 0xf018 && type <= 0xf117)))
break;
// The image size must be 0 or greater
// (0 is allowed, but odd, since we do wind on by the header each
// time, so we won't get stuck)