From 1e6eb8dfff41be5567a5ea2e1730a7e00b5726f1 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 7 Jun 2017 01:51:01 +0800 Subject: Avoid using fz_var() when not necessary. --- source/fitz/image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/fitz/image.c b/source/fitz/image.c index d530b6e3..f2edf564 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -687,13 +687,13 @@ fz_get_pixmap_from_image(fz_context *ctx, fz_image *image, const fz_irect *subar /* Now we try to cache the pixmap. Any failure here will just result * in us not caching. */ - fz_var(keyp); + keyp = fz_malloc_struct(ctx, fz_image_key); + keyp->refs = 1; + fz_try(ctx) { fz_pixmap *existing_tile; - keyp = fz_malloc_struct(ctx, fz_image_key); - keyp->refs = 1; keyp->image = fz_keep_image_store_key(ctx, image); keyp->l2factor = l2factor; keyp->rect = key.rect; -- cgit v1.2.3