summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pdf/pdf_image.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index 9626d6f0..22cca81d 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -505,6 +505,9 @@ pdf_load_jpx(pdf_document *xref, fz_obj *dict, pdf_image *image)
img = fz_load_jpx(ctx, buf->data, buf->len, colorspace);
/* RJW: "cannot load jpx image" */
+ if (img && colorspace == NULL)
+ colorspace = fz_keep_colorspace(ctx, img->colorspace);
+
fz_drop_buffer(ctx, buf);
buf = NULL;