pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1712836 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
Date Thu, 05 Nov 2015 18:03:47 GMT
Author: tilman
Date: Thu Nov  5 18:03:47 2015
New Revision: 1712836

URL: http://svn.apache.org/viewvc?rev=1712836&view=rev
Log:
PDFBOX-3090: avoid ArrayIndexOutOfBoundsException

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

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java?rev=1712836&r1=1712835&r2=1712836&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java Thu Nov  5
18:03:47 2015
@@ -488,6 +488,13 @@ public class CmapSubtable
                 {
                     p = (p + idDelta) % 65536;
                 }
+                
+                if (p >= numGlyphs)
+                {
+                    LOG.warn("glyphId " + p + " for charcode " + charCode + " ignored, numGlyphs
is " + numGlyphs);
+                    continue;
+                }
+                
                 glyphIdToCharacterCode[p] = charCode;
                 characterCodeToGlyphId.put(charCode, p);
             }



Mime
View raw message