summaryrefslogtreecommitdiff
path: root/source/fitz/draw-mesh.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-05-08 01:45:10 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-05-08 21:03:26 +0800
commit9368e0565b98af5295b846be31087ca2111d4fe6 (patch)
treeff08ed07a16619af8f9adbbc8a85183f833efde3 /source/fitz/draw-mesh.c
parent31de71cfe7e38e335da9503564ef499c405cc6f7 (diff)
downloadmupdf-9368e0565b98af5295b846be31087ca2111d4fe6.tar.xz
Bug 697864: Free temporary pixmaps only if created.
Previously this caused memory checker errors due to a non-temporary pixmap being accidentally freed and then later reused as expected.
Diffstat (limited to 'source/fitz/draw-mesh.c')
-rw-r--r--source/fitz/draw-mesh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/fitz/draw-mesh.c b/source/fitz/draw-mesh.c
index cbce5dbf..a40cdd12 100644
--- a/source/fitz/draw-mesh.c
+++ b/source/fitz/draw-mesh.c
@@ -288,8 +288,11 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap
}
fz_catch(ctx)
{
- fz_drop_pixmap(ctx, conv);
- fz_drop_pixmap(ctx, temp);
+ if (shade->use_function)
+ {
+ fz_drop_pixmap(ctx, conv);
+ fz_drop_pixmap(ctx, temp);
+ }
fz_rethrow(ctx);
}
}