diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 259caeae3..42497beb1 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 46182 - fixed Slideshow.readPictures() to skip pictures with invalid headers 46137 - Handle odd files with a ContinueRecord after EOFRecord Fixed problem with linking shared formulas when ranges overlap 45784 - More fixes to SeriesTextRecord diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 3cef6f652..baec54a04 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,7 +34,8 @@ - 46137 - Handle odd files with a ContinueRecord after EOFRecord + 46182 - fixed Slideshow.readPictures() to skip pictures with invalid headers + 46137 - Handle odd files with a ContinueRecord after EOFRecord Fixed problem with linking shared formulas when ranges overlap 45784 - More fixes to SeriesTextRecord 46033 - fixed TableCell to correctly set text type diff --git a/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java index 217ab7bc8..8273d87cc 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java @@ -333,17 +333,16 @@ public final class HSLFSlideShow extends POIDocument { logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length " + imgsize + ".\nYou document will probably become corrupted if you save it!"); logger.log(POILogger.ERROR, "" + pos); } else { - // Copy the data, ready to pass to PictureData - byte[] imgdata = new byte[imgsize]; - if(imgsize > 0) { - System.arraycopy(pictstream, pos, imgdata, 0, imgdata.length); - } - // Build the PictureData object from the data try { PictureData pict = PictureData.create(type - 0xF018); - pict.setRawData(imgdata); - pict.setOffset(offset); + + // Copy the data, ready to pass to PictureData + byte[] imgdata = new byte[imgsize]; + System.arraycopy(pictstream, pos, imgdata, 0, imgdata.length); + pict.setRawData(imgdata); + + pict.setOffset(offset); p.add(pict); } catch(IllegalArgumentException e) { logger.log(POILogger.ERROR, "Problem reading picture: " + e + "\nYou document will probably become corrupted if you save it!");