From 9e37ab56eb677ac66f0c313a73a685c57cf66731 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 15 Oct 2011 14:43:00 +0000 Subject: [PATCH] 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 --- src/documentation/content/xdocs/status.xml | 1 + src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 1f3b4e7c7b..97282270b0 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51566 - HSLF fix for finishing parsing the picture stream on the first non-valid type 51974 - Avoid HWPF issue when identifying the picture type 52035 - Fix signed issue with very large word 6 files 51949 - Avoid NPE on double close of ZipFileZipEntrySource diff --git a/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java index 6fb390218c..0e9984b2ca 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java @@ -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) -- 2.39.5