You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/09/23 18:24:08 UTC

svn commit: r1627081 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Author: tilman
Date: Tue Sep 23 16:24:07 2014
New Revision: 1627081

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1627081&r1=1627080&r2=1627081&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Tue Sep 23 16:24:07 2014
@@ -483,10 +483,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);
         }