From 78179a6f0cdbf84ca2344e1ca22c04ae6c701364 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 6 Jan 2012 11:27:08 +0000 Subject: pdfshow; cope better with broken objects In pdfshow, if we fail to parse an object, just skip it rather than aborting. Thanks to Zeniko for the suggestion. --- apps/pdfshow.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/pdfshow.c') diff --git a/apps/pdfshow.c b/apps/pdfshow.c index 86743de3..e10e5e08 100644 --- a/apps/pdfshow.c +++ b/apps/pdfshow.c @@ -152,7 +152,15 @@ static void showgrep(char *filename) { if (xref->table[i].type == 'n' || xref->table[i].type == 'o') { - obj = pdf_load_object(xref, i, 0); + fz_try(ctx) + { + obj = pdf_load_object(xref, i, 0); + } + fz_catch(ctx) + { + fz_warn(ctx, "skipping object (%d 0 R)", i); + continue; + } fz_sort_dict(obj); -- cgit v1.2.3