pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1704386 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
Date Mon, 21 Sep 2015 18:56:40 GMT
Author: tilman
Date: Mon Sep 21 18:56:40 2015
New Revision: 1704386

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

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

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java?rev=1704386&r1=1704385&r2=1704386&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
Mon Sep 21 18:56:40 2015
@@ -41,7 +41,12 @@ public class ShowTextGlyph extends Opera
      */
     public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
     {
-        COSArray array = (COSArray)arguments.get( 0 );
+        COSBase base = arguments.get(0);
+        if (!(base instanceof COSArray))
+        {
+            return;
+        }
+        COSArray array = (COSArray) base;
         int arraySize = array.size();
         float fontsize = context.getGraphicsState().getTextState().getFontSize();
         float horizontalScaling = context.getGraphicsState().getTextState().getHorizontalScalingPercent()/100;



Mime
View raw message