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 2025/02/15 10:41:09 UTC

svn commit: r1923836 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Author: tilman
Date: Sat Feb 15 10:41:09 2025
New Revision: 1923836

URL: http://svn.apache.org/viewvc?rev=1923836&view=rev
Log:
PDFBOX-5957: optimize

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1923836&r1=1923835&r2=1923836&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Sat Feb 15 10:41:09 2025
@@ -398,7 +398,7 @@ public class PDFStreamParser extends Bas
             }
 
             // PDFBOX-3742: just assuming that 1-3 non blanks is a PDF operator isn't enough
-            if (endOpIdx != -1 && startOpIdx != -1)
+            if (noBinData && endOpIdx != -1 && startOpIdx != -1)
             {
                 // usually, the operator here is Q, sometimes EMC (PDFBOX-2376), S (PDFBOX-3784)
                 s = new String(binCharTestArr, startOpIdx, endOpIdx - startOpIdx);
@@ -410,7 +410,7 @@ public class PDFStreamParser extends Bas
             }
 
             // only if not close to EOF
-            if (startOpIdx != -1 && readBytes == MAX_BIN_CHAR_TEST_LENGTH) 
+            if (noBinData && startOpIdx != -1 && readBytes == MAX_BIN_CHAR_TEST_LENGTH) 
             {
                 if (endOpIdx == -1)
                 {