diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java index 56eb0a0d9e..cddacf9fed 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java @@ -17,6 +17,7 @@ package org.apache.poi.hslf.extractor; +import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.List; @@ -31,6 +32,7 @@ import org.apache.poi.hwpf.HWPFDocument; import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.util.IOUtils; /** * Tests that the extractor correctly gets the text out of our sample file @@ -203,7 +205,20 @@ public final class TestExtractor extends TestCase { assertEquals("Expected 2 embedded Excel Spreadsheets", 2, num_xls); assertEquals("Expected 2 embedded PowerPoint Presentations", 2, num_ppt); } - + + /** + * A powerpoint file with embeded powerpoint files + */ + public void test52991() throws Exception { + String path = "badzip.ppt"; + ppe = new PowerPointExtractor(POIDataSamples.getSlideShowInstance().openResourceAsStream(path)); + List shapes = ppe.getOLEShapes(); + + for (OLEShape shape : shapes) { + IOUtils.copy(shape.getObjectData().getData(), new ByteArrayOutputStream()); + } + } + /** * From bug #45543 */ diff --git a/test-data/slideshow/badzip.ppt b/test-data/slideshow/badzip.ppt new file mode 100644 index 0000000000..c8ff00e04d Binary files /dev/null and b/test-data/slideshow/badzip.ppt differ