pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1781699 - /pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
Date Sat, 04 Feb 2017 19:49:34 GMT
Author: tilman
Date: Sat Feb  4 19:49:34 2017
New Revision: 1781699

URL: http://svn.apache.org/viewvc?rev=1781699&view=rev
Log:
PDFBOX-3676: remove arguments after bad CALLSUBR

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

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java?rev=1781699&r1=1781698&r2=1781699&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
(original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
Sat Feb  4 19:49:34 2017
@@ -101,6 +101,17 @@ public class Type1CharStringParser
                         sequence.remove(sequence.size()-1); // remove "return" command
                     }
                 }
+                else
+                {
+                    LOG.warn("CALLSUBR is ignored, operand: " + operand
+                            + ", subrs.size(): " + subrs.size() + " in glyph '"
+                            + glyphName + "' of font " + fontName);
+                    // remove all parameters (there can be more than one)
+                    while (sequence.get(sequence.size() - 1) instanceof Integer)
+                    {
+                        sequence.remove(sequence.size() - 1);
+                    }
+                }
             }
             else if (b0 == TWO_BYTE && input.peekUnsignedByte(0) == CALLOTHERSUBR)
             {



Mime
View raw message