summaryrefslogtreecommitdiff
path: root/platform/x11
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/x11
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/x11')
-rw-r--r--platform/x11/pdfapp.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index 0b0abafc..ef834aa1 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -407,12 +407,9 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps)
}
fz_catch(ctx)
{
+ app->outline = NULL;
if (fz_caught(ctx) == FZ_ERROR_TRYLATER)
- {
app->outline_deferred = PDFAPP_OUTLINE_DEFERRED;
- }
- else
- fz_rethrow(ctx);
}
break;
}
@@ -818,13 +815,9 @@ void pdfapp_reloadpage(pdfapp_t *app)
if (app->outline_deferred == PDFAPP_OUTLINE_LOAD_NOW)
{
fz_try(app->ctx)
- {
app->outline = fz_load_outline(app->ctx, app->doc);
- }
fz_catch(app->ctx)
- {
- /* Ignore any error now */
- }
+ app->outline = NULL;
app->outline_deferred = 0;
}
pdfapp_showpage(app, 1, 1, 1, 0, 0);