From 9b1bf2de4a098a494142c27f0dc3f4d2b8327f80 Mon Sep 17 00:00:00 2001 From: Robert Meyer Date: Tue, 3 Dec 2013 10:05:07 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); -- 2.39.5