summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-07-06 22:05:54 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-07-06 22:05:54 +0800
commit25f1234830855d9d7a5f1ab40241df971579e1af (patch)
treee20849119da2dfa08b350bffff5a3f7926f53a9b /source
parent04915b552a7e193a887a337558abed8175d1ff1f (diff)
downloadmupdf-25f1234830855d9d7a5f1ab40241df971579e1af.tar.xz
png: Drop pixmap when not writing an image without pixels.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/output-png.c4
1 files changed, 4 insertions, 0 deletions
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);