pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1696812 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
Date Thu, 20 Aug 2015 16:02:52 GMT
Author: tilman
Date: Thu Aug 20 16:02:52 2015
New Revision: 1696812

URL: http://svn.apache.org/r1696812
Log:
PDFBOX-2939: assume an empty glyph if 1 contour and -1 end point index

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java?rev=1696812&r1=1696811&r2=1696812&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java Thu
Aug 20 16:02:52 2015
@@ -65,8 +65,15 @@ public class GlyfSimpleDescript extends
         // Simple glyph description
         endPtsOfContours = bais.readUnsignedShortArray(numberOfContours);
 
+        int lastEndPt = endPtsOfContours[numberOfContours - 1];
+        if (numberOfContours == 1 && lastEndPt == 65535)
+        {
+            // PDFBOX-2939: assume an empty glyph
+            pointCount = 0;
+            return;
+        }
         // The last end point index reveals the total number of points
-        pointCount = endPtsOfContours[numberOfContours - 1] + 1;
+        pointCount = lastEndPt + 1;
 
         flags = new byte[pointCount];
         xCoordinates = new short[pointCount];



Mime
View raw message