summaryrefslogtreecommitdiff
path: root/source/tools/pdfextract.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-08-12 11:57:30 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-08-12 11:57:30 +0200
commitd189e83e201c7df66e9cb6e84e468d877ecea0ff (patch)
tree363ca246e1400736256210ff5eaded5f5ee2ddef /source/tools/pdfextract.c
parentbb0251a59a6cc5c1cb7cb0b31f7e74397db4e348 (diff)
downloadmupdf-d189e83e201c7df66e9cb6e84e468d877ecea0ff.tar.xz
Fix 695411: Catch errors when loading objects in mutool extract.
Diffstat (limited to 'source/tools/pdfextract.c')
-rw-r--r--source/tools/pdfextract.c19
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)