pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1837606 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Tue, 07 Aug 2018 16:08:44 GMT
Author: tilman
Date: Tue Aug  7 16:08:44 2018
New Revision: 1837606

URL: http://svn.apache.org/viewvc?rev=1837606&view=rev
Log:
PDFBOX-4288: don't add objects that are already fully parsed and are ignored later, as suggested
by Hee Jeong Kim

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=1837606&r1=1837605&r2=1837606&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 Tue Aug 
7 16:08:44 2018
@@ -602,7 +602,9 @@ public class COSParser extends BaseParse
 
     /**
      * Adds newObject to toBeParsedList if it is not an COSObject or we didn't
-     * add this COSObject already (checked via addedObjects).
+     * add this COSObject already (checked via addedObjects). Simple objects are
+     * not added because nothing is done with them when toBeParsedList is
+     * processed.
      */
     private void addNewToList(final Queue<COSBase> toBeParsedList, final COSBase newObject,
             final Set<Long> addedObjects)
@@ -614,8 +616,12 @@ public class COSParser extends BaseParse
             {
                 return;
             }
+            toBeParsedList.add(newObject);
+        }
+        else if (newObject instanceof COSDictionary || newObject instanceof COSArray)
+        {
+            toBeParsedList.add(newObject);
         }
-        toBeParsedList.add(newObject);
     }
 
     /**



Mime
View raw message