]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2323: NPE caused by missing local subroutine index in private dictonary of OTF...
authorRobert Meyer <rmeyer@apache.org>
Tue, 3 Dec 2013 10:05:07 +0000 (10:05 +0000)
committerRobert Meyer <rmeyer@apache.org>
Tue, 3 Dec 2013 10:05:07 +0000 (10:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1547330 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java

index dbea482165fbfddf2a3c77fd0c4477b03ecad949..906fbd5e0e13718859262cb348a58e10728d3b8e 100644 (file)
@@ -561,8 +561,12 @@ public class OTFSubSetFile extends OTFFile {
             int privateOffset = privateEntry.getOperands().get(1).intValue();
             Map<String, DICTEntry> privateDICT = cffReader.getPrivateDict(privateEntry);
 
-            int localSubrOffset = privateOffset + privateDICT.get("Subrs").getOperands().get(0).intValue();
-            localIndexSubr = cffReader.readIndex(localSubrOffset);
+            if (privateDICT.get("Subrs") != null) {
+                int localSubrOffset = privateOffset + privateDICT.get("Subrs").getOperands().get(0).intValue();
+                localIndexSubr = cffReader.readIndex(localSubrOffset);
+            } else {
+                localIndexSubr = cffReader.readIndex(null);
+            }
         }
 
         globalIndexSubr = cffReader.getGlobalIndexSubr();