summaryrefslogtreecommitdiff
path: root/pdf/pdf_stream.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-17 00:07:09 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-17 00:07:09 +0000
commitc53b6af33c996a7ae6815ac15254297d43f43a9c (patch)
treefb3a9d65ec564cacc60d8a59b2310867ae0926cb /pdf/pdf_stream.c
parent6888c5757779610c9da201e34b70c1800b898616 (diff)
downloadmupdf-c53b6af33c996a7ae6815ac15254297d43f43a9c.tar.xz
Change stream 'close' functions to facilitate error cleanup.
Rather than passing a stream to a close function, just pass context and state - that's all that is required. This enables us to call close to cleanup neatly if the stream fails to allocate.
Diffstat (limited to 'pdf/pdf_stream.c')
-rw-r--r--pdf/pdf_stream.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/pdf/pdf_stream.c b/pdf/pdf_stream.c
index 625fbc76..83131860 100644
--- a/pdf/pdf_stream.c
+++ b/pdf/pdf_stream.c
@@ -199,18 +199,10 @@ pdf_open_filter(fz_stream *chain, pdf_xref *xref, fz_obj *stmobj, int num, int g
chain = pdf_open_raw_filter(chain, xref, stmobj, num, gen);
- fz_try(ctx)
- {
- if (fz_is_name(filters))
- chain = build_filter(chain, xref, filters, params, num, gen);
- else if (fz_array_len(filters) > 0)
- chain = build_filter_chain(chain, xref, filters, params, num, gen);
- }
- fz_catch(ctx)
- {
- fz_close(chain);
- fz_rethrow(ctx);
- }
+ if (fz_is_name(filters))
+ chain = build_filter(chain, xref, filters, params, num, gen);
+ else if (fz_array_len(filters) > 0)
+ chain = build_filter_chain(chain, xref, filters, params, num, gen);
return chain;
}