From e3e89a4b73a956ffb74d7a49d80f2d58235b7292 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Mon, 6 Aug 2012 00:27:42 +0200 Subject: Free inline image dictionary upon error parsing image --- pdf/pdf_interpret.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'pdf') diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index 03e09587..8c1e40e6 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -1643,9 +1643,19 @@ static void pdf_run_BI(pdf_csi *csi, pdf_obj *rdb, fz_stream *file) if (fz_peek_byte(file) == '\n') fz_read_byte(file); - img = pdf_load_inline_image(csi->xref, rdb, obj, file); - pdf_drop_obj(obj); - /* RJW: "cannot load inline image" */ + fz_try(ctx) + { + img = pdf_load_inline_image(csi->xref, rdb, obj, file); + } + fz_always(ctx) + { + pdf_drop_obj(obj); + } + fz_catch(ctx) + { + /* RJW: "cannot load inline image" */ + fz_rethrow(ctx); + } pdf_show_image(csi, img); -- cgit v1.2.3