summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-12-28 15:02:29 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-01-09 17:45:34 +0100
commit7570499f1622857b3b7432cac7c300acfb12340a (patch)
tree661cfccd6caf5f14f96560a52c7175e88a607a8d
parent1d76658b8a5166edb2e56f206fd125eec4aed050 (diff)
downloadmupdf-7570499f1622857b3b7432cac7c300acfb12340a.tar.xz
Add missing pdf_close_processor calls.
-rw-r--r--source/pdf/pdf-clean.c6
-rw-r--r--source/pdf/pdf-run.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/source/pdf/pdf-clean.c b/source/pdf/pdf-clean.c
index ff54e6e7..680795a1 100644
--- a/source/pdf/pdf-clean.c
+++ b/source/pdf/pdf-clean.c
@@ -34,6 +34,8 @@ pdf_clean_stream_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_ob
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, obj, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
pdf_update_stream(ctx, doc, obj, buffer, 0);
@@ -94,6 +96,8 @@ pdf_clean_type3(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_obj *orig_
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, orig_res, res);
pdf_process_contents(ctx, proc_filter, doc, orig_res, val, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
pdf_update_stream(ctx, doc, val, buffer, 0);
}
@@ -159,6 +163,8 @@ void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page,
proc_filter = pdf_new_filter_processor(ctx, proc_buffer, doc, resources, res);
pdf_process_contents(ctx, proc_filter, doc, resources, contents, cookie);
+ pdf_close_processor(ctx, proc_filter);
+ pdf_close_processor(ctx, proc_buffer);
/* Deal with page content stream. */
diff --git a/source/pdf/pdf-run.c b/source/pdf/pdf-run.c
index ba8b30b7..e00ad02b 100644
--- a/source/pdf/pdf-run.c
+++ b/source/pdf/pdf-run.c
@@ -12,7 +12,10 @@ pdf_run_annot_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf
proc = pdf_new_run_processor(ctx, dev, &local_ctm, usage, NULL, 0);
fz_try(ctx)
+ {
pdf_process_annot(ctx, proc, doc, page, annot, cookie);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)
@@ -39,7 +42,10 @@ pdf_run_page_contents_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *p
proc = pdf_new_run_processor(ctx, dev, &local_ctm, usage, NULL, 0);
fz_try(ctx)
+ {
pdf_process_contents(ctx, proc, doc, resources, contents, cookie);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)
@@ -170,7 +176,10 @@ pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer
proc = pdf_new_run_processor(ctx, dev, ctm, "View", gstate, nested_depth+1);
fz_try(ctx)
+ {
pdf_process_glyph(ctx, proc, doc, resources, contents);
+ pdf_close_processor(ctx, proc);
+ }
fz_always(ctx)
pdf_drop_processor(ctx, proc);
fz_catch(ctx)