summaryrefslogtreecommitdiff
path: root/xps/xps_outline.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-03-14 14:59:46 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-03-14 15:29:56 +0100
commitbcb88cede5edb232ac87235d957c023a0397bd5e (patch)
tree2522fb8d1a31cf9421b245ecc05747dde9e72010 /xps/xps_outline.c
parent621e33bdb921bdc3ccd9068101acd3858c9c14c8 (diff)
downloadmupdf-bcb88cede5edb232ac87235d957c023a0397bd5e.tar.xz
Miscellaneous fixes for XPS from SumatraPDf.
Diffstat (limited to 'xps/xps_outline.c')
-rw-r--r--xps/xps_outline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xps/xps_outline.c b/xps/xps_outline.c
index 6bf7fd14..0feb7b24 100644
--- a/xps/xps_outline.c
+++ b/xps/xps_outline.c
@@ -94,6 +94,8 @@ xps_load_document_structure(xps_document *doc, xps_fixdoc *fixdoc)
fz_rethrow(doc->ctx);
}
xps_free_part(doc, part);
+ if (!root)
+ return NULL;
fz_try(doc->ctx)
{
@@ -118,10 +120,16 @@ xps_load_outline(xps_document *doc)
for (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next) {
if (fixdoc->outline) {
outline = xps_load_document_structure(doc, fixdoc);
+ if (!outline)
+ continue;
if (!head)
head = outline;
else
+ {
+ while (tail->next)
+ tail = tail->next;
tail->next = outline;
+ }
tail = outline;
}
}