aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorRobert Meyer <rmeyer@apache.org>2013-12-03 10:05:07 +0000
committerRobert Meyer <rmeyer@apache.org>2013-12-03 10:05:07 +0000
commit9b1bf2de4a098a494142c27f0dc3f4d2b8327f80 (patch)
tree4660a7bb2d23bd2a9b310afd0097e46ee4fb97f2 /src/java
parentca51f4c9117dfba007fc26b9b6ebc2c0914d9d3d (diff)
downloadxmlgraphics-fop-9b1bf2de4a098a494142c27f0dc3f4d2b8327f80.tar.gz
xmlgraphics-fop-9b1bf2de4a098a494142c27f0dc3f4d2b8327f80.zip
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
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java8
1 files 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<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();