From c8dc1547226920f64f14d6aa4ad5d40563dc6845 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Sat, 25 Feb 2012 11:31:33 -0800 Subject: Fix assert/SEGVs seen in cluster due to using a color image as a mask. When loading a JPX image with no specified colorspace, we were ending with image->colorspace being set to NULL. This caused us to treat the image as a mask. The correct fix is to inherit the colorspace from the jpx once loaded. --- pdf/pdf_image.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pdf') 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; -- cgit v1.2.3