diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-17 11:40:57 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-17 11:40:57 +0000 |
commit | e319037177565d45a6678d879bc12c1756718f5e (patch) | |
tree | b98bbea0d74a7f1b04b4835444d7b52be2292a9a | |
parent | 880ed0a3dd992d4ab6b8f1d73f862fb930dc2eaa (diff) | |
download | mupdf-e319037177565d45a6678d879bc12c1756718f5e.tar.xz |
More memsqueezing fixes.
-rw-r--r-- | pdf/pdf_stream.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pdf/pdf_stream.c b/pdf/pdf_stream.c index 83131860..39b35977 100644 --- a/pdf/pdf_stream.c +++ b/pdf/pdf_stream.c @@ -155,15 +155,17 @@ build_filter_chain(fz_stream *chain, pdf_xref *xref, fz_obj *fs, fz_obj *ps, int * stream length, followed by a decryption filter. */ static fz_stream * -pdf_open_raw_filter(fz_stream *orig, pdf_xref *xref, fz_obj *stmobj, int num, int gen) +pdf_open_raw_filter(fz_stream *chain, pdf_xref *xref, fz_obj *stmobj, int num, int gen) { int hascrypt; int len; - fz_context *ctx = orig->ctx; - fz_stream *chain; + fz_context *ctx = chain->ctx; + + /* don't close chain when we close this filter */ + fz_keep_stream(chain); len = fz_to_int(fz_dict_gets(stmobj, "Length")); - chain = fz_open_null(orig, len); + chain = fz_open_null(chain, len); fz_try(ctx) { @@ -177,9 +179,6 @@ pdf_open_raw_filter(fz_stream *orig, pdf_xref *xref, fz_obj *stmobj, int num, in fz_rethrow(ctx); } - /* don't close the original stream when we close this filter */ - fz_keep_stream(orig); - return chain; } |