poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r713009 - in /poi/trunk/src: documentation/content/xdocs/changes.xml documentation/content/xdocs/status.xml scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
Date Tue, 11 Nov 2008 10:07:09 GMT
Author: yegor
Date: Tue Nov 11 02:07:08 2008
New Revision: 713009

URL: http://svn.apache.org/viewvc?rev=713009&view=rev
Log:
fixed bug#46182:  Slideshow.readPictures()  skips pictures with invalid headers

Modified:
    poi/trunk/src/documentation/content/xdocs/changes.xml
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java

Modified: poi/trunk/src/documentation/content/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/changes.xml?rev=713009&r1=713008&r2=713009&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/changes.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/changes.xml Tue Nov 11 02:07:08 2008
@@ -37,6 +37,7 @@
 
 		<!-- Don't forget to update status.xml too! -->
         <release version="3.5-beta4" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">46182 - fixed Slideshow.readPictures()
to skip pictures with invalid headers</action>
            <action dev="POI-DEVELOPERS" type="fix">46137 - Handle odd files with a
ContinueRecord after EOFRecord</action>
            <action dev="POI-DEVELOPERS" type="fix">Fixed problem with linking shared
formulas when ranges overlap</action>
            <action dev="POI-DEVELOPERS" type="fix">45784 - More fixes to SeriesTextRecord</action>

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=713009&r1=713008&r2=713009&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Tue Nov 11 02:07:08 2008
@@ -34,7 +34,8 @@
 	<!-- Don't forget to update changes.xml too! -->
     <changes>
         <release version="3.5-beta4" date="2008-??-??">
-			<action dev="POI-DEVELOPERS" type="fix">46137 - Handle odd files with a ContinueRecord
after EOFRecord</action>
+           <action dev="POI-DEVELOPERS" type="fix">46182 - fixed Slideshow.readPictures()
to skip pictures with invalid headers</action>
+     			 <action dev="POI-DEVELOPERS" type="fix">46137 - Handle odd files with a ContinueRecord
after EOFRecord</action>
            <action dev="POI-DEVELOPERS" type="fix">Fixed problem with linking shared
formulas when ranges overlap</action>
            <action dev="POI-DEVELOPERS" type="fix">45784 - More fixes to SeriesTextRecord</action>
            <action dev="POI-DEVELOPERS" type="fix">46033 - fixed TableCell to correctly
set text type</action>

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java?rev=713009&r1=713008&r2=713009&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java Tue Nov 11 02:07:08
2008
@@ -333,17 +333,16 @@
 				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!");



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message