summaryrefslogtreecommitdiff
path: root/platform/gl/gl-main.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-18 13:02:01 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-21 11:11:46 +0100
commitbff572a7365209f36a16951296384974c80ad3d5 (patch)
tree7d63479831c8edc24bc5933a1ef61c376a8dd6b2 /platform/gl/gl-main.c
parentac6ebbe38e6edb6074b1b73707770a9a4e9979b8 (diff)
downloadmupdf-bff572a7365209f36a16951296384974c80ad3d5.tar.xz
Harden viewers against failures when loading outlines.
Ignore invalid page references in outlines. This was shown by a file that had [null 0 0 1] as a link dest. Attempting to parse that threw an error, which caused the whole outline load to fail.
Diffstat (limited to 'platform/gl/gl-main.c')
-rw-r--r--platform/gl/gl-main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index 46c65262..8300bc0a 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -755,7 +755,11 @@ static void reload(void)
fz_layout_document(ctx, doc, layout_w, layout_h, layout_em);
- outline = fz_load_outline(ctx, doc);
+ fz_try(ctx)
+ outline = fz_load_outline(ctx, doc);
+ fz_catch(ctx)
+ outline = NULL;
+
pdf = pdf_specifics(ctx, doc);
if (pdf)
pdf_enable_js(ctx, pdf);