You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/10/21 17:45:24 UTC

svn commit: r1844507 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java

Author: tilman
Date: Sun Oct 21 17:45:24 2018
New Revision: 1844507

URL: http://svn.apache.org/viewvc?rev=1844507&view=rev
Log:
PDFBOX-4347: don't set -1 if value is missing, this can result in an ArrayIndexOutOfBoundsException

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java?rev=1844507&r1=1844506&r2=1844507&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java Sun Oct 21 17:45:24 2018
@@ -119,9 +119,9 @@ public class PDFXrefStreamParser extends
         /*
          * Calculating the size of the line in bytes
          */
-        int w0 = xrefFormat.getInt(0);
-        int w1 = xrefFormat.getInt(1);
-        int w2 = xrefFormat.getInt(2);
+        int w0 = xrefFormat.getInt(0, 0);
+        int w1 = xrefFormat.getInt(1, 0);
+        int w2 = xrefFormat.getInt(2, 0);
         int lineSize = w0 + w1 + w2;
 
         while(!seqSource.isEOF() && objIter.hasNext())