diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-29 14:39:51 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-11-23 19:45:47 +0800 |
commit | 9c0a767a678fcf3aa70ef98c356b911f4a405450 (patch) | |
tree | 0fdf9835aee18bdf6ebe57e0e8b4eaf81e4a8615 | |
parent | e0fa7401cacd6a11ac8471fea35944f33f1e0070 (diff) | |
download | mupdf-9c0a767a678fcf3aa70ef98c356b911f4a405450.tar.xz |
jxr: Plug pixmap leak upon error converting CMYK image to RGB.
-rw-r--r-- | source/fitz/load-jxr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c index 4321c32f..a501e341 100644 --- a/source/fitz/load-jxr.c +++ b/source/fitz/load-jxr.c @@ -398,11 +398,13 @@ fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size) jxr_read_image(ctx, data, size, &info, 0); + image = fz_new_pixmap(ctx, info.cspace, info.width, info.height, 1); + + image->xres = info.xres; + image->yres = info.yres; + fz_try(ctx) { - image = fz_new_pixmap(ctx, info.cspace, info.width, info.height, 1); - image->xres = info.xres; - image->yres = info.yres; fz_unpack_tile(ctx, image, info.samples, fz_colorspace_n(ctx, info.cspace) + 1, 8, info.stride, 0); @@ -428,6 +430,7 @@ fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size) } fz_catch(ctx) { + fz_drop_pixmap(ctx, image); fz_rethrow(ctx); } |