pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1755213 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
Date Thu, 04 Aug 2016 16:48:52 GMT
Author: tilman
Date: Thu Aug  4 16:48:52 2016
New Revision: 1755213

URL: http://svn.apache.org/viewvc?rev=1755213&view=rev
Log:
PDFBOX-3426: avoid ArrayIndexOutOfBoundsException if cmapTable.getCmaps() is empty

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

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1755213&r1=1755212&r2=1755213&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java Thu Aug  4
16:48:52 2016
@@ -560,7 +560,7 @@ public class TrueTypeFont implements Fon
             {
                 throw new IOException("The TrueType font does not contain a Unicode cmap");
             }
-            else
+            else if (cmapTable.getCmaps().length > 0)
             {
                 // fallback to the first cmap (may not be Unicode, so may produce poor results)
                 cmap = cmapTable.getCmaps()[0];



Mime
View raw message