summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-06-24 15:19:42 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-07-06 22:03:27 +0800
commitf1c13d6ac84c6dd2948f2c2173d1a5e064780ed4 (patch)
treee3d8f480e1e1c7544563769848270e8787c8744b
parent77df78f382e292cc08dce7e96fa4a9f655bb4075 (diff)
downloadmupdf-f1c13d6ac84c6dd2948f2c2173d1a5e064780ed4.tar.xz
pdfapp: Handle PDF javascript not loading.
-rw-r--r--platform/x11/pdfapp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index e5b7ed9e..14c83ef4 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -284,6 +284,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps)
{
fz_context *ctx = app->ctx;
char *password = "";
+ pdf_document *idoc;
fz_try(ctx)
{
@@ -356,17 +357,22 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps)
pdfapp_error(app, "cannot open document");
}
- fz_try(ctx)
+ idoc = pdf_specifics(app->ctx, app->doc);
+ if (idoc)
{
- pdf_document *idoc;
-
- idoc = pdf_specifics(app->ctx, app->doc);
-
- if (idoc)
+ fz_try(ctx)
{
pdf_enable_js(ctx, idoc);
pdf_set_doc_event_callback(ctx, idoc, event_cb, app);
}
+ fz_catch(ctx)
+ {
+ pdfapp_error(app, "cannot load javascript embedded in document");
+ }
+ }
+
+ fz_try(ctx)
+ {
if (fz_needs_password(app->ctx, app->doc))
{