pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1716207 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text: ShowText.java ShowTextAdjusted.java
Date Tue, 24 Nov 2015 16:52:32 GMT
Author: tilman
Date: Tue Nov 24 16:52:31 2015
New Revision: 1716207

URL: http://svn.apache.org/viewvc?rev=1716207&view=rev
Log:
PDFBOX-3129: avoid NPE if Tj / TJ is not within BT...ET

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextAdjusted.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java?rev=1716207&r1=1716206&r2=1716207&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java
Tue Nov 24 16:52:31 2015
@@ -46,6 +46,11 @@ public class ShowText extends OperatorPr
             // ignore
             return;
         }
+        if (context.getTextMatrix() == null)
+        {
+            // ignore: outside of BT...ET
+            return;
+        }
         COSString string = (COSString) base;
         context.showTextString(string.getBytes());
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextAdjusted.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextAdjusted.java?rev=1716207&r1=1716206&r2=1716207&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextAdjusted.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextAdjusted.java
Tue Nov 24 16:52:31 2015
@@ -43,6 +43,11 @@ public class ShowTextAdjusted extends Op
         {
             return;
         }
+        if (context.getTextMatrix() == null)
+        {
+            // ignore: outside of BT...ET
+            return;
+        }
         COSArray array = (COSArray) base;
         context.showTextStrings(array);
     }



Mime
View raw message