pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1631259 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
Date Sun, 12 Oct 2014 21:38:33 GMT
Author: lehmi
Date: Sun Oct 12 21:38:32 2014
New Revision: 1631259

URL: http://svn.apache.org/r1631259
Log:
PDFBOX-2395: avoid IOOB exception

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1631259&r1=1631258&r2=1631259&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Sun Oct 12
21:38:32 2014
@@ -1368,10 +1368,10 @@ public class COSWriter implements ICOSVi
                     md5.update( values.next().toString().getBytes("ISO-8859-1") );
                 }
             }
-            idArray = new COSArray();
             // reuse origin documentID if available as first value
             COSString firstID = missingID ? new COSString( md5.digest() ) : (COSString)idArray.get(0);
             COSString secondID = new COSString( md5.digest() );
+            idArray = new COSArray();
             idArray.add( firstID );
             idArray.add( secondID );
             trailer.setItem( COSName.ID, idArray );



Mime
View raw message