diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-06-23 12:58:42 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-06-23 12:58:42 +0200 |
commit | 19ade764f4184b46de12dd8ee52d161af159bd57 (patch) | |
tree | a2019e3f3f7e68cdc1e51fdf95f1e7e5e6b6e291 | |
parent | f7b746878a1697d6add86ffe51804be9ae87eea3 (diff) | |
download | mupdf-19ade764f4184b46de12dd8ee52d161af159bd57.tar.xz |
Stop scanning the file for more objects after encountering a lexing error. This will help when files have garbage on the end.
-rw-r--r-- | mupdf/pdf_repair.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mupdf/pdf_repair.c b/mupdf/pdf_repair.c index ed526cab..d7451c27 100644 --- a/mupdf/pdf_repair.c +++ b/mupdf/pdf_repair.c @@ -176,8 +176,8 @@ pdf_repairxref(pdf_xref *xref, char *buf, int bufsize) error = pdf_lex(&tok, xref->file, buf, bufsize, &len); if (error) { - error = fz_rethrow(error, "cannot scan for objects"); - goto cleanup; + fz_catch(error, "ignoring the rest of the file"); + break; } if (tok == PDF_TINT) |