summaryrefslogtreecommitdiff
path: root/fitz/filt_jbig2d.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-14 17:36:57 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-09-15 14:50:17 +0100
commitb51ef0eea028c73b6379e832eaa34fff3fbbb927 (patch)
tree1ab685ccd356e7fdc832b2e3322c0486b2670cfb /fitz/filt_jbig2d.c
parent89ae81f651bfa112b8e07317eb6983beaf7cb212 (diff)
downloadmupdf-b51ef0eea028c73b6379e832eaa34fff3fbbb927.tar.xz
Add context to mupdf.
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
Diffstat (limited to 'fitz/filt_jbig2d.c')
-rw-r--r--fitz/filt_jbig2d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fitz/filt_jbig2d.c b/fitz/filt_jbig2d.c
index ad335045..18aa0a22 100644
--- a/fitz/filt_jbig2d.c
+++ b/fitz/filt_jbig2d.c
@@ -38,7 +38,7 @@ close_jbig2d(fz_stream *stm)
jbig2_global_ctx_free(state->gctx);
jbig2_ctx_free(state->ctx);
fz_close(state->chain);
- fz_free(state);
+ fz_free(stm->ctx, state);
}
static int
@@ -85,7 +85,7 @@ fz_open_jbig2d(fz_stream *chain, fz_buffer *globals)
{
fz_jbig2d *state;
- state = fz_malloc(sizeof(fz_jbig2d));
+ state = fz_malloc(chain->ctx, sizeof(fz_jbig2d));
state->chain = chain;
state->ctx = jbig2_ctx_new(NULL, JBIG2_OPTIONS_EMBEDDED, NULL, NULL, NULL);
state->gctx = NULL;
@@ -99,5 +99,5 @@ fz_open_jbig2d(fz_stream *chain, fz_buffer *globals)
state->ctx = jbig2_ctx_new(NULL, JBIG2_OPTIONS_EMBEDDED, state->gctx, NULL, NULL);
}
- return fz_new_stream(state, read_jbig2d, close_jbig2d);
+ return fz_new_stream(chain->ctx, state, read_jbig2d, close_jbig2d);
}