diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-08-12 11:57:30 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-08-12 11:57:30 +0200 |
commit | d189e83e201c7df66e9cb6e84e468d877ecea0ff (patch) | |
tree | 363ca246e1400736256210ff5eaded5f5ee2ddef /source | |
parent | bb0251a59a6cc5c1cb7cb0b31f7e74397db4e348 (diff) | |
download | mupdf-d189e83e201c7df66e9cb6e84e468d877ecea0ff.tar.xz |
Fix 695411: Catch errors when loading objects in mutool extract.
Diffstat (limited to 'source')
-rw-r--r-- | source/tools/pdfextract.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c index b46cccbd..0304845f 100644 --- a/source/tools/pdfextract.c +++ b/source/tools/pdfextract.c @@ -166,14 +166,21 @@ static void showobject(int num) if (!doc) fz_throw(ctx, FZ_ERROR_GENERIC, "no file specified"); - obj = pdf_load_object(doc, num, 0); + fz_try(ctx) + { + obj = pdf_load_object(doc, num, 0); - if (isimage(obj)) - saveimage(num); - else if (isfontdesc(obj)) - savefont(obj, num); + if (isimage(obj)) + saveimage(num); + else if (isfontdesc(obj)) + savefont(obj, num); - pdf_drop_obj(obj); + pdf_drop_obj(obj); + } + fz_catch(ctx) + { + fz_warn(ctx, "ignoring object %d", num); + } } int pdfextract_main(int argc, char **argv) |