pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1668372 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Sun, 22 Mar 2015 14:01:24 GMT
Author: lehmi
Date: Sun Mar 22 14:01:24 2015
New Revision: 1668372

URL: http://svn.apache.org/r1668372
Log:
PDFBOX-2679: don't search for an object at the very beginning of a pdf

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1668372&r1=1668371&r2=1668372&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java Sun Mar 22
14:01:24 2015
@@ -1218,6 +1218,11 @@ public class COSParser extends BaseParse
      */
     private COSObjectKey checkObjectKeys(COSObjectKey objectKey, long offset) throws IOException
     {
+        // there can't be any object at the very beginning of a pdf
+        if (offset < MINIMUM_SEARCH_OFFSET)
+        {
+            return null;
+        }
         long objectNr = objectKey.getNumber();
         int objectGen = objectKey.getGeneration();
         long originOffset = pdfSource.getOffset();



Mime
View raw message