From 25f1234830855d9d7a5f1ab40241df971579e1af Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 6 Jul 2017 22:05:54 +0800 Subject: png: Drop pixmap when not writing an image without pixels. --- source/fitz/output-png.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/fitz/output-png.c') diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c index 87c69428..0c0edf97 100644 --- a/source/fitz/output-png.c +++ b/source/fitz/output-png.c @@ -314,7 +314,11 @@ png_from_pixmap(fz_context *ctx, fz_pixmap *pix, const fz_color_params *color_pa fz_var(pix2); if (pix->w == 0 || pix->h == 0) + { + if (drop) + fz_drop_pixmap(ctx, pix); return NULL; + } if (color_params == NULL) color_params = fz_default_color_params(ctx); -- cgit v1.2.3