summaryrefslogtreecommitdiff
path: root/source/fitz/draw-mesh.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2018-01-24 00:34:58 +0100
committerSebastian Rasmussen <sebras@gmail.com>2018-01-24 15:29:23 +0100
commit4889fe51af274e0c158a0a8a2e6132c700937427 (patch)
tree01bc9dd005e14602e978dbc4b152def7253ba6fb /source/fitz/draw-mesh.c
parent8fdad62ddb46f8798643e9b1a564a2af8b12411d (diff)
downloadmupdf-4889fe51af274e0c158a0a8a2e6132c700937427.tar.xz
Make sure to drop color converter when painting shades, even upon error.
Diffstat (limited to 'source/fitz/draw-mesh.c')
-rw-r--r--source/fitz/draw-mesh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/fitz/draw-mesh.c b/source/fitz/draw-mesh.c
index b8bf68d2..1856ddb7 100644
--- a/source/fitz/draw-mesh.c
+++ b/source/fitz/draw-mesh.c
@@ -216,6 +216,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, cons
unsigned char clut[256][FZ_MAX_COLORS];
fz_pixmap *temp = NULL;
fz_pixmap *conv = NULL;
+ fz_color_converter cc = { 0 };
float color[FZ_MAX_COLORS];
struct paint_tri_data ptd = { 0 };
int i, k;
@@ -305,11 +306,10 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, cons
int da;
int sa = temp->alpha;
int hh = temp->h;
-
- fz_color_converter cc;
int cn = fz_colorspace_n(ctx, colorspace);
int m = dest->n - dest->alpha;
int n = fz_colorspace_n(ctx, dest->colorspace);
+
fz_find_color_converter(ctx, &cc, NULL, dest->colorspace, colorspace, color_params);
for (i = 0; i < 256; i++)
{
@@ -350,6 +350,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *colorspace, cons
{
if (shade->use_function)
{
+ fz_drop_color_converter(ctx, &cc);
fz_drop_pixmap(ctx, temp);
fz_drop_pixmap(ctx, conv);
}