From feee1fce120ddd0273fab03a32912487468f4c29 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 1 Nov 2016 15:07:50 +0100 Subject: Don't dereference NULL subarea when rasterizing display list images. --- source/fitz/image.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/fitz/image.c') diff --git a/source/fitz/image.c b/source/fitz/image.c index 7373147f..d88cc578 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -575,11 +575,13 @@ fz_get_pixmap_from_image(fz_context *ctx, fz_image *image, const fz_irect *subar if (image->scalable) { /* If the image is scalable, we always want to re-render and never cache. */ - fz_irect subarea_copy = *subarea; + fz_irect subarea_copy; + if (subarea) + subarea_copy = *subarea; l2factor_remaining = 0; if (dw) *dw = w; if (dh) *dh = h; - return image->get_pixmap(ctx, image, &subarea_copy, image->w, image->h, &l2factor_remaining); + return image->get_pixmap(ctx, image, subarea ? &subarea_copy : NULL, image->w, image->h, &l2factor_remaining); } /* Clamp requested image size, since we never want to magnify images here. */ -- cgit v1.2.3