summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-09-05 09:59:19 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-09-06 21:52:16 +0800
commit2d3eca6dec6b8fc7a169b3fc357904069df6b6c4 (patch)
treed89569e37bcb58cc4138678775a736592a6734df /source/pdf
parentc648955c79231d750dc43a0514f3612b41e35294 (diff)
downloadmupdf-2d3eca6dec6b8fc7a169b3fc357904069df6b6c4.tar.xz
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.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-op-run.c4
1 files changed, 4 insertions, 0 deletions
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);