pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1627082 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Date Tue, 23 Sep 2014 16:24:57 GMT
Author: tilman
Date: Tue Sep 23 16:24:57 2014
New Revision: 1627082

URL: http://svn.apache.org/r1627082
Log:
PDFBOX-2376: disable heuristics for ID...EI near end of stream

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

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1627082&r1=1627081&r2=1627082&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Tue Sep 23 16:24:57 2014
@@ -484,10 +484,13 @@ public class PDFStreamParser extends Bas
                     }
                 }
             }
-            // a PDF operator is 1-3 bytes long
-            if (endOpIdx == -1 || startOpIdx == -1 || endOpIdx - startOpIdx > 3)
+            if (readBytes == maxBinCharTestLength) // only if not close to eof
             {
-                noBinData = false;
+                // a PDF operator is 1-3 bytes long
+                if (endOpIdx == -1 || startOpIdx == -1 || endOpIdx - startOpIdx > 3)
+                {
+                    noBinData = false;
+                }
             }
             pdfSource.unread(binCharTestArr, 0, readBytes);
         }



Mime
View raw message