pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1811590 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Mon, 09 Oct 2017 18:16:06 GMT
Author: lehmi
Date: Mon Oct  9 18:16:06 2017
New Revision: 1811590

URL: http://svn.apache.org/viewvc?rev=1811590&view=rev
Log:
PDFBOX-3955: don't parse object stream multiple times

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=1811590&r1=1811589&r2=1811590&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 Mon Oct 
9 18:16:06 2017
@@ -1960,19 +1960,19 @@ public class COSParser extends BaseParse
             // handle compressed objects
             if (offset < 0)
             {
-                parseObjectStream((int) -offset);
                 COSObject compressedObject = document.getObjectFromPool(entry.getKey());
-                if (compressedObject != null)
+                if (compressedObject.getObject() == null)
                 {
-                    COSBase baseObject = compressedObject.getObject();
-                    if (baseObject instanceof COSDictionary)
-                    {
-                        dictionary = (COSDictionary) baseObject;
-                    }
-                    else
-                    {
-                        continue;
-                    }
+                    parseObjectStream((int) -offset);
+                }
+                COSBase baseObject = compressedObject.getObject();
+                if (baseObject instanceof COSDictionary)
+                {
+                    dictionary = (COSDictionary) baseObject;
+                }
+                else
+                {
+                    continue;
                 }
             }
             else



Mime
View raw message