pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1704409 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextLineAndSpace.java
Date Mon, 21 Sep 2015 19:42:27 GMT
Author: tilman
Date: Mon Sep 21 19:42:26 2015
New Revision: 1704409

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextLineAndSpace.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextLineAndSpace.java?rev=1704409&r1=1704408&r2=1704409&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextLineAndSpace.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/ShowTextLineAndSpace.java
Mon Sep 21 19:42:26 2015
@@ -23,6 +23,7 @@ import org.apache.pdfbox.contentstream.o
 import org.apache.pdfbox.contentstream.operator.OperatorProcessor;
 
 import java.io.IOException;
+import org.apache.pdfbox.contentstream.operator.MissingOperandException;
 
 /**
  * ": Set word and character spacing, move to next line, and show text.
@@ -34,6 +35,10 @@ public class ShowTextLineAndSpace extend
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
+        if (arguments.size() < 3)
+        {
+            throw new MissingOperandException(operator, arguments);
+        }
         context.processOperator("Tw", arguments.subList(0,1));
         context.processOperator("Tc", arguments.subList(1,2));
         context.processOperator("'", arguments.subList(2,3));



Mime
View raw message