summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-10-30 01:19:59 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-12-14 20:39:20 +0100
commit7b7e2a607614ffd14774a350ec0f4570149c7465 (patch)
tree3aea2760415070968a0ea0d209578b3df886a470
parent337df9247e7c00cc32305c51014b7c9f037f2d68 (diff)
downloadmupdf-7b7e2a607614ffd14774a350ec0f4570149c7465.tar.xz
jpx: Only do YCC-to-RGB conversion if decoding image samples.
-rw-r--r--source/fitz/load-jpx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
index 583aec02..17e78d7e 100644
--- a/source/fitz/load-jpx.c
+++ b/source/fitz/load-jpx.c
@@ -852,6 +852,9 @@ jpx_read_image(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace
}
}
+ if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 3 && a == 0)
+ jpx_ycc_to_rgb(ctx, img, 1, 1);
+
if (a)
{
/* CMYK is a subtractive colorspace, we want additive for premul alpha */
@@ -865,9 +868,6 @@ jpx_read_image(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace
}
}
- if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 3 && a == 0)
- jpx_ycc_to_rgb(ctx, img, 1, 1);
-
opj_image_destroy(jpx);
return img;