diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2018-09-26 01:34:16 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2018-10-12 15:50:49 +0800 |
commit | 98d7d24e67664600aeb346d2abfa29ff2f9653b1 (patch) | |
tree | 50881a380ab5cfdc56df024e062a3aff650cb245 | |
parent | 886f91221527e8cb706d8e1824b4d4cfa8c86505 (diff) | |
download | mupdf-98d7d24e67664600aeb346d2abfa29ff2f9653b1.tar.xz |
Corrected stream reference counting.
-rw-r--r-- | source/fitz/filter-sgi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/fitz/filter-sgi.c b/source/fitz/filter-sgi.c index 43bade71..fdd7a1e1 100644 --- a/source/fitz/filter-sgi.c +++ b/source/fitz/filter-sgi.c @@ -313,22 +313,19 @@ fz_open_sgilog16(fz_context *ctx, fz_stream *chain, int w) { fz_sgilog16 *state = NULL; - fz_var(state); - + state = fz_malloc_struct(ctx, fz_sgilog16); fz_try(ctx) { - state = fz_malloc_struct(ctx, fz_sgilog16); - state->chain = chain; state->run = 0; state->n = 0; state->c = 0; state->w = w; state->temp = fz_malloc(ctx, w * sizeof(uint16_t)); + state->chain = fz_keep_stream(ctx, chain); } fz_catch(ctx) { fz_free(ctx, state); - fz_drop_stream(ctx, chain); fz_rethrow(ctx); } |