From e9d1966e2427f630fb2a7c2a1d322ae35db6efc8 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 8 Dec 2011 13:17:08 +0000 Subject: Fix lack of output with "719 - EOF incorrectly detected.pdf" When converting to exception handling I'd messed up an error handling case; when failing to pdf_lex in pdf_repair_xref I had allowed the error to just carry on being thrown rather than catching it and cleaning up. This was resulting in not getting any output for the above file, rather than outputting as much as we could. Simple fix. --- pdf/pdf_repair.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pdf/pdf_repair.c') diff --git a/pdf/pdf_repair.c b/pdf/pdf_repair.c index abc443cc..7930b5b5 100644 --- a/pdf/pdf_repair.c +++ b/pdf/pdf_repair.c @@ -247,8 +247,15 @@ pdf_repair_xref(pdf_xref *xref, char *buf, int bufsize) if (tmpofs < 0) fz_throw(ctx, "cannot tell in file"); - tok = pdf_lex(xref->file, buf, bufsize, &n); - /* RJW: "ignoring the rest of the file" */ + fz_try(ctx) + { + tok = pdf_lex(xref->file, buf, bufsize, &n); + } + fz_catch(ctx) + { + fz_warn(ctx, "ignoring the rest of the file"); + break; + } if (tok == PDF_TOK_INT) { -- cgit v1.2.3