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 2015/09/21 20:48:05 UTC

svn commit: r1704384 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java

Author: tilman
Date: Mon Sep 21 18:48:05 2015
New Revision: 1704384

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

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java?rev=1704384&r1=1704383&r2=1704384&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java Mon Sep 21 18:48:05 2015
@@ -46,7 +46,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.processEncodedText( string.getBytes() );
     }