diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-06 11:27:08 +0000 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2012-01-06 13:49:24 +0000 |
commit | 78179a6f0cdbf84ca2344e1ca22c04ae6c701364 (patch) | |
tree | 2ccfd7c0c9a50c19b3b22874c38520e4a0529582 | |
parent | 3a7c49e637e8e1a580ecacae7558671d05ae0979 (diff) | |
download | mupdf-78179a6f0cdbf84ca2344e1ca22c04ae6c701364.tar.xz |
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.
-rw-r--r-- | apps/pdfshow.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |