pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1728509 - /pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
Date Thu, 04 Feb 2016 16:51:38 GMT
Author: lehmi
Date: Thu Feb  4 16:51:38 2016
New Revision: 1728509

URL: http://svn.apache.org/viewvc?rev=1728509&view=rev
Log:
PDFBOX-3226: skip empty format 6 cmap tables to avoid NoSuchElementException

Modified:
    pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java

Modified: pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java?rev=1728509&r1=1728508&r2=1728509&view=diff
==============================================================================
--- pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
(original)
+++ pdfbox/branches/1.8/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
Thu Feb  4 16:51:38 2016
@@ -315,6 +315,11 @@ public class CMAPEncodingEntry
     {
         int firstCode = data.readUnsignedShort();
         int entryCount = data.readUnsignedShort();
+        // skip emtpy tables
+        if (entryCount == 0)
+        {
+            return;
+        }
         Map<Integer, Integer> tmpGlyphToChar = new HashMap<Integer, Integer>();
         int[] glyphIdArray = data.readUnsignedShortArray(entryCount);
         for (int i = 0; i < entryCount; i++)



Mime
View raw message