summaryrefslogtreecommitdiff
path: root/xps/xps_resource.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-06 15:03:53 +0000
committerRobin Watts <robin.watts@artifex.com>2012-01-06 15:07:05 +0000
commitd6fab6582c26c133589c83134e76e7a29ff57962 (patch)
tree8400088a29440ae22254f845adc162c9bf012703 /xps/xps_resource.c
parent95f29c10759bc42e940869f1a0d2f82db16f8709 (diff)
downloadmupdf-d6fab6582c26c133589c83134e76e7a29ff57962.tar.xz
XPS tweaks/fixes.
xps_parse_resource_dictionary can now warn and return NULL when reading an empty dictionary, rather than throwing an error. Various bits of code are therefore updated to check for a NULL return value. We should cope better with multiple Resource dictionaries. Tweak to the zip file handling when looking for parts. Again, all from (or inspired by) Zenikos patch.
Diffstat (limited to 'xps/xps_resource.c')
-rw-r--r--xps/xps_resource.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xps/xps_resource.c b/xps/xps_resource.c
index fad60488..cfac562d 100644
--- a/xps/xps_resource.c
+++ b/xps/xps_resource.c
@@ -80,7 +80,8 @@ xps_parse_remote_resource_dictionary(xps_document *doc, char *base_uri, char *so
s[1] = 0;
dict = xps_parse_resource_dictionary(doc, part_uri, xml);
- dict->base_xml = xml; /* pass on ownership */
+ if (dict)
+ dict->base_xml = xml; /* pass on ownership */
return dict;
}
@@ -119,7 +120,7 @@ xps_parse_resource_dictionary(xps_document *doc, char *base_uri, xml_element *ro
if (head)
head->base_uri = fz_strdup(doc->ctx, base_uri);
else
- fz_throw(doc->ctx, "empty resource dictionary");
+ fz_warn(doc->ctx, "empty resource dictionary");
return head;
}