pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1704383 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.java
Date Mon, 21 Sep 2015 18:47:33 GMT
Author: tilman
Date: Mon Sep 21 18:47:32 2015
New Revision: 1704383

URL: http://svn.apache.org/viewvc?rev=1704383&view=rev
Log:
PDFBOX-2982: avoid ClassCastException

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowText.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=1704383&r1=1704382&r2=1704383&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
Mon Sep 21 18:47:32 2015
@@ -40,7 +40,13 @@ public class ShowText extends OperatorPr
             // ignore ( )Tj
             return;
         }
-        COSString string = (COSString)arguments.get( 0 );
+        COSBase base = arguments.get(0);
+        if (!(base instanceof COSString))
+        {
+            // ignore
+            return;
+        }
+        COSString string = (COSString) base;
         context.showTextString(string.getBytes());
     }
 



Mime
View raw message