pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1761982 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/XrefTrailerResolver.java
Date Thu, 22 Sep 2016 17:26:09 GMT
Author: tilman
Date: Thu Sep 22 17:26:09 2016
New Revision: 1761982

URL: http://svn.apache.org/viewvc?rev=1761982&view=rev
Log:
PDFBOX-3506: check before adding to the map, to avoid entries from the table being overwritten
by obsolete entries in hybrid files

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/XrefTrailerResolver.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/XrefTrailerResolver.java?rev=1761982&r1=1761981&r2=1761982&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/XrefTrailerResolver.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/XrefTrailerResolver.java
Thu Sep 22 17:26:09 2016
@@ -165,7 +165,12 @@ public class XrefTrailerResolver
             LOG.warn( "Cannot add XRef entry for '" + objKey.getNumber() + "' because XRef
start was not signalled." );
             return;
         }
-        curXrefTrailerObj.xrefTable.put( objKey, offset );
+        // PDFBOX-3506 check before adding to the map, to avoid entries from the table being

+        // overwritten by obsolete entries in hybrid files (/XRefStm entry)
+        if (!curXrefTrailerObj.xrefTable.containsKey(objKey) )
+        {
+            curXrefTrailerObj.xrefTable.put(objKey, offset);
+        }
     }
 
     /**



Mime
View raw message