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:56:40 UTC
svn commit: r1704386 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
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;