summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-08 13:17:08 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-08 13:17:08 +0000
commite9d1966e2427f630fb2a7c2a1d322ae35db6efc8 (patch)
tree54760053282ebb78b36e530509ed36f4d674c4a7
parent5ded75b01e51e71aa9d3229b657b5420a28bcb89 (diff)
downloadmupdf-e9d1966e2427f630fb2a7c2a1d322ae35db6efc8.tar.xz
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.
-rw-r--r--pdf/pdf_repair.c11
1 files changed, 9 insertions, 2 deletions
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)
{