pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1737133 - in /pdfbox/branches/2.0: ./ pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
Date Wed, 30 Mar 2016 16:31:46 GMT
Author: lehmi
Date: Wed Mar 30 16:31:45 2016
New Revision: 1737133

URL: http://svn.apache.org/viewvc?rev=1737133&view=rev
Log:
PDFBOX-3295: compare the object stream index instead of simply checking if it exists

Modified:
    pdfbox/branches/2.0/   (props changed)
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java  
(contents, props changed)
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java

Propchange: pdfbox/branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 30 16:31:45 2016
@@ -1,3 +1,3 @@
 /pdfbox/branches/no-awt:1618517-1621410
 /pdfbox/no-awt:1618514-1618516
-/pdfbox/trunk:1736223,1736227,1736615,1737043
+/pdfbox/trunk:1736223,1736227,1736615,1737043,1737130

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=1737133&r1=1737132&r2=1737133&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 Wed
Mar 30 16:31:45 2016
@@ -840,7 +840,8 @@ public class COSParser extends BaseParse
             for (COSObject next : parser.getObjects())
             {
                 COSObjectKey stmObjKey = new COSObjectKey(next);
-                if (xrefTrailerResolver.getXrefTable().containsKey(stmObjKey))
+                Long offset = xrefTrailerResolver.getXrefTable().get(stmObjKey); 
+                if (offset != null && offset == -objstmObjNr)
                 {
                     COSObject stmObj = document.getObjectFromPool(stmObjKey);
                     stmObj.setObject(next.getObject());

Propchange: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 30 16:31:45 2016
@@ -1,4 +1,4 @@
 /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java:1641458
 /pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java:1618517-1621410
 /pdfbox/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java:1618514-1618516
-/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java:1737043
+/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java:1737043,1737130

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java?rev=1737133&r1=1737132&r2=1737133&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/parser/PreflightParser.java
Wed Mar 30 16:31:45 2016
@@ -833,7 +833,8 @@ public class PreflightParser extends PDF
                     for (COSObject next : parser.getObjects())
                     {
                         COSObjectKey stmObjKey = new COSObjectKey(next);
-                        if (xrefTrailerResolver.getXrefTable().containsKey(stmObjKey))
+                        Long offset = xrefTrailerResolver.getXrefTable().get(stmObjKey);

+                        if (offset != null && offset == -objstmObjNr)
                         {
                             COSObject stmObj = document.getObjectFromPool(stmObjKey);
                             stmObj.setObject(next.getObject());



Mime
View raw message