pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1762126 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
Date Sat, 24 Sep 2016 15:25:46 GMT
Author: tilman
Date: Sat Sep 24 15:25:46 2016
New Revision: 1762126

URL: http://svn.apache.org/viewvc?rev=1762126&view=rev
Log:
PDFBOX-3511: avoid NullPointerException

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

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java?rev=1762126&r1=1762125&r2=1762126&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java Sat
Sep 24 15:25:46 2016
@@ -256,7 +256,7 @@ public class GlyfCompositeDescript exten
         for (GlyfCompositeComp c : components)
         {
             GlyphDescription gd = descriptions.get(c.getGlyphIndex());
-            if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount()))
+            if (c.getFirstIndex() <= i && gd != null && i < (c.getFirstIndex()
+ gd.getPointCount()))
             {
                 return c;
             }
@@ -269,7 +269,7 @@ public class GlyfCompositeDescript exten
         for (GlyfCompositeComp c : components)
         {
             GlyphDescription gd = descriptions.get(c.getGlyphIndex());
-            if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount()))
+            if (c.getFirstContour() <= i && gd != null && i < (c.getFirstContour()
+ gd.getContourCount()))
             {
                 return c;
             }



Mime
View raw message