diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-17 00:07:09 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-17 00:07:09 +0000 |
commit | c53b6af33c996a7ae6815ac15254297d43f43a9c (patch) | |
tree | fb3a9d65ec564cacc60d8a59b2310867ae0926cb /fitz/filt_jbig2d.c | |
parent | 6888c5757779610c9da201e34b70c1800b898616 (diff) | |
download | mupdf-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 'fitz/filt_jbig2d.c')
-rw-r--r-- | fitz/filt_jbig2d.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fitz/filt_jbig2d.c b/fitz/filt_jbig2d.c index e90be9f8..69e3df50 100644 --- a/fitz/filt_jbig2d.c +++ b/fitz/filt_jbig2d.c @@ -29,16 +29,16 @@ struct fz_jbig2d_s }; static void -close_jbig2d(fz_stream *stm) +close_jbig2d(fz_context *ctx, void *state_) { - fz_jbig2d *state = stm->state; + fz_jbig2d *state = (fz_jbig2d *)state_; if (state->page) jbig2_release_page(state->ctx, state->page); if (state->gctx) jbig2_global_ctx_free(state->gctx); jbig2_ctx_free(state->ctx); fz_close(state->chain); - fz_free(stm->ctx, state); + fz_free(ctx, state); } static int |