From 34c971b594bad41fa6c2ad4a9798e5a18de129b5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 8 Dec 2011 15:32:03 +0100 Subject: Throw exceptions for read errors. --- pdf/pdf_xref.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pdf') diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index b447dde6..65c695f6 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -424,7 +424,7 @@ pdf_read_xref_sections(pdf_xref *xref, int ofs, char *buf, int cap) fz_catch(ctx) { fz_drop_obj(trailer); - fz_throw(ctx, "Failed to read xref at offset %d", ofs); + fz_throw(ctx, "cannot read xref at offset %d", ofs); } fz_drop_obj(trailer); @@ -675,6 +675,7 @@ pdf_open_xref_with_stream(fz_stream *file, char *password) fz_drop_obj(xref->trailer); xref->trailer = NULL; } + fz_warn(xref->ctx, "trying to repair broken xref"); pdf_repair_xref(xref, xref->scratch, sizeof xref->scratch); repaired = 1; } -- cgit v1.2.3