pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1654303 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
Date Fri, 23 Jan 2015 18:42:30 GMT
Author: lehmi
Date: Fri Jan 23 18:42:30 2015
New Revision: 1654303

URL: http://svn.apache.org/r1654303
Log:
PDFBOX-2615: skip endobject marker when reading an object stream

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java?rev=1654303&r1=1654302&r2=1654303&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
Fri Jan 23 18:42:30 2015
@@ -120,6 +120,13 @@ public class PDFObjectStreamParser exten
                 {
                     LOG.debug( "parsed=" + object );
                 }
+                // According to the spec objects within an object stream shall not be enclosed

+                // by obj/endobj tags, but there are some pdfs in the wild using those tags

+                // skip endobject marker if present
+                if (!pdfSource.isEOF() && pdfSource.peek() == 'e')
+                {
+                    readLine();
+                }
                 objectCounter++;
             }
         }



Mime
View raw message