From 2d3eca6dec6b8fc7a169b3fc357904069df6b6c4 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Mon, 5 Sep 2016 09:59:19 +0800 Subject: Luminosity transparency group must have colorspace when used as softmask. Previously no fallbacks happened if the colorspace was not set, now gray is assumed. The reason this is safe is that the softmasks backdrop color entry is always filled with one component value (possibly being 0) matching the gray component of the colorspace. --- source/pdf/pdf-op-run.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/pdf') diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index aad0aebf..a3dca30c 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -138,6 +138,10 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save) gstate->ctm = gstate->softmask_ctm; mask_colorspace = pdf_xobject_colorspace(ctx, softmask); + + if (gstate->luminosity && !mask_colorspace) + mask_colorspace = fz_device_gray(ctx); + fz_try(ctx) { fz_begin_mask(ctx, pr->dev, &mask_bbox, gstate->luminosity, mask_colorspace, gstate->softmask_bc); -- cgit v1.2.3