diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-05-07 18:16:10 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-05-08 15:14:58 +0100 |
commit | 13943b92f10796efb175e769afe5b0aea85d879a (patch) | |
tree | 5de598704fca598c33ca09a2cda07f0e659b886e /pdf/pdf_parse.c | |
parent | 636652daee46a9cf9836746135e3f9678db796ec (diff) | |
download | mupdf-13943b92f10796efb175e769afe5b0aea85d879a.tar.xz |
Bug 693028 - improve mupdf viewer handling of broken page streams
Currently, if a page stream cannot be read, mupdf gives an alert box
and then exits. This is annoying when reading a large pdf.
Here we change the code to only exit if a page is completely broken;
in the case of missing page contents, or missing links, we give a warning
and just render the best we can.
Also, update a couple of error messages to be less misleading.
Diffstat (limited to 'pdf/pdf_parse.c')
-rw-r--r-- | pdf/pdf_parse.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c index fe9db368..b1472d1a 100644 --- a/pdf/pdf_parse.c +++ b/pdf/pdf_parse.c @@ -453,21 +453,19 @@ pdf_parse_ind_obj(pdf_document *xref, fz_var(obj); tok = pdf_lex(file, buf); - /* RJW: cannot parse indirect object (%d %d R)", num, gen */ if (tok != PDF_TOK_INT) - fz_throw(ctx, "expected object number (%d %d R)", num, gen); + fz_throw(ctx, "expected object number"); num = buf->i; tok = pdf_lex(file, buf); - /* RJW: "cannot parse indirect object (%d %d R)", num, gen */ if (tok != PDF_TOK_INT) - fz_throw(ctx, "expected generation number (%d %d R)", num, gen); + fz_throw(ctx, "expected generation number (%d ? obj)", num); gen = buf->i; tok = pdf_lex(file, buf); /* RJW: "cannot parse indirect object (%d %d R)", num, gen */ if (tok != PDF_TOK_OBJ) - fz_throw(ctx, "expected 'obj' keyword (%d %d R)", num, gen); + fz_throw(ctx, "expected 'obj' keyword (%d %d ?)", num, gen); tok = pdf_lex(file, buf); /* RJW: "cannot parse indirect object (%d %d R)", num, gen */ |