pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1712834 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
Date Thu, 05 Nov 2015 17:45:07 GMT
Author: tilman
Date: Thu Nov  5 17:45:07 2015
New Revision: 1712834

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

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java?rev=1712834&r1=1712833&r2=1712834&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java Thu
Nov  5 17:45:07 2015
@@ -81,7 +81,14 @@ public class Type1CharStringParser
             if (b0 == CALLSUBR)
             {
                 // callsubr command
-                Integer operand=(Integer)sequence.remove(sequence.size()-1);
+                Object obj = sequence.remove(sequence.size() - 1);
+                if (!(obj instanceof Integer))
+                {
+                    LOG.warn("Parameter " + obj + " for CALLSUBR is ignored, integer expected
in glyph '"
+                            + glyphName + "' of font " + fontName);
+                    continue;
+                }
+                Integer operand = (Integer) obj;
 
                 if (operand >= 0 && operand < subrs.size())
                 {



Mime
View raw message