From 19ade764f4184b46de12dd8ee52d161af159bd57 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Jun 2010 12:58:42 +0200 Subject: Stop scanning the file for more objects after encountering a lexing error. This will help when files have garbage on the end. --- mupdf/pdf_repair.c | 4 ++-- 1 file 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) -- cgit v1.2.3