From 98d7d24e67664600aeb346d2abfa29ff2f9653b1 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 26 Sep 2018 01:34:16 +0800 Subject: Corrected stream reference counting. --- source/fitz/filter-sgi.c | 7 ++----- 1 file 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); } -- cgit v1.2.3