summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-10-08 11:23:45 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-10-09 13:17:56 +0800
commitf0dbccef7458d6a432377d505d85baaed2e77a84 (patch)
treee4fb013dccf4e843a155d02aac94720a97fe6166 /source
parent858b661a14521840d6428c1e4b9d3a0e2a677c1f (diff)
downloadmupdf-f0dbccef7458d6a432377d505d85baaed2e77a84.tar.xz
Fix HAVE_JPEGXR and HAVE_LURATECH code for colorspace changes.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/load-jpx.c4
-rw-r--r--source/fitz/load-jxr.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
index 48b65217..fe2d0cf7 100644
--- a/source/fitz/load-jpx.c
+++ b/source/fitz/load-jpx.c
@@ -364,13 +364,13 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
if (defcs)
{
- if (defcs->n == state->nchans)
+ if (fz_colorspace_n(ctx, defcs) == state->nchans)
{
state->cs = defcs;
}
else
{
- fz_warn(ctx, "jpx file (%lu) and dict colorspace (%d, %s) do not match", state->nchans, defcs->n, defcs->name);
+ fz_warn(ctx, "jpx file (%lu) and dict colorspace (%d, %s) do not match", state->nchans, fz_colorspace_n(ctx, defcs), fz_colorspace_name(ctx, defcs));
defcs = NULL;
}
}
diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c
index c76c86dc..3742b49e 100644
--- a/source/fitz/load-jxr.c
+++ b/source/fitz/load-jxr.c
@@ -252,7 +252,7 @@ jxr_decode_block_alpha(jxr_image_t image, int mx, int my, int *data)
mx *= 16;
my *= 16;
- n = fz_colorspace_n(ctx, n);
+ n = fz_colorspace_n(ctx, info->cspace);
for (y = 0; y < 16; y++)
{
if ((my + y) >= info->height)
@@ -264,7 +264,7 @@ jxr_decode_block_alpha(jxr_image_t image, int mx, int my, int *data)
{
if ((mx + x) < info->width)
{
- jxr_unpack_alpha_sample(ctx, info, image, data, n);
+ jxr_unpack_alpha_sample(ctx, info, image, data, p + n);
p += n + 1;
}
@@ -404,7 +404,7 @@ fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size)
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);
+ fz_unpack_tile(ctx, image, info.samples, fz_colorspace_n(ctx, info.cspace) + 1, 8, info.stride, 0);
if (info.has_alpha && !info.has_premul)
{