pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1704418 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
Date Mon, 21 Sep 2015 20:32:46 GMT
Author: tilman
Date: Mon Sep 21 20:32:46 2015
New Revision: 1704418

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

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

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java?rev=1704418&r1=1704417&r2=1704418&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
Mon Sep 21 20:32:46 2015
@@ -43,7 +43,16 @@ public class SetTextRise extends Operato
      */
     public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
     {
-        COSNumber rise = (COSNumber)arguments.get(0);
+        if (arguments.size() < 1)
+        {
+            return;
+        }
+        COSBase base = arguments.get(0);
+        if (!(base instanceof COSNumber))
+        {
+            return;
+        }
+        COSNumber rise = (COSNumber) base;
         context.getGraphicsState().getTextState().setRise( rise.floatValue() );
     }
 }



Mime
View raw message