From: Robert Meyer Date: Tue, 3 Dec 2013 10:05:07 +0000 (+0000) Subject: FOP-2323: NPE caused by missing local subroutine index in private dictonary of OTF... X-Git-Tag: fop-2_0~156 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9b1bf2de4a098a494142c27f0dc3f4d2b8327f80;p=xmlgraphics-fop.git FOP-2323: NPE caused by missing local subroutine index in private dictonary of OTF font git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1547330 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java index dbea48216..906fbd5e0 100644 --- a/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java +++ b/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java @@ -561,8 +561,12 @@ public class OTFSubSetFile extends OTFFile { int privateOffset = privateEntry.getOperands().get(1).intValue(); Map 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();