pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1811589 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Mon, 09 Oct 2017 18:14:22 GMT
Author: lehmi
Date: Mon Oct  9 18:14:22 2017
New Revision: 1811589

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

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1811589&r1=1811588&r2=1811589&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java Mon
Oct  9 18:14:22 2017
@@ -1969,19 +1969,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