summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf/pdf-stream.c')
-rw-r--r--source/pdf/pdf-stream.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/pdf/pdf-stream.c b/source/pdf/pdf-stream.c
index f747a54b..0f568f16 100644
--- a/source/pdf/pdf-stream.c
+++ b/source/pdf/pdf-stream.c
@@ -298,12 +298,22 @@ pdf_open_filter(fz_stream *chain, pdf_document *doc, pdf_obj *stmobj, int num, i
chain = pdf_open_raw_filter(chain, doc, stmobj, num, num, gen, offset);
+ fz_var(chain);
+
fz_try(doc->ctx)
{
if (pdf_is_name(filters))
- chain = build_filter(chain, doc, filters, params, num, gen, imparams);
+ {
+ fz_stream *chain2 = chain;
+ chain = NULL;
+ chain = build_filter(chain2, doc, filters, params, num, gen, imparams);
+ }
else if (pdf_array_len(filters) > 0)
- chain = build_filter_chain(chain, doc, filters, params, num, gen, imparams);
+ {
+ fz_stream *chain2 = chain;
+ chain = NULL;
+ chain = build_filter_chain(chain2, doc, filters, params, num, gen, imparams);
+ }
}
fz_catch(doc->ctx)
{