pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1755212&r1=1755211&r2=1755212&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java Thu
Aug  4 16:48:48 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