From 79bc9c182e74bcd58c6de33be8dfeb384a07199b Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 25 Sep 2017 19:22:49 +0100 Subject: Fix separations object handling when cloning for spots. The 'producing spots' case is poorly tested, but I believe we should be keeping the spot information internally, rather than NULLing it out. --- source/fitz/separation.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/fitz/separation.c b/source/fitz/separation.c index 5f8fee41..f4f5e262 100644 --- a/source/fitz/separation.c +++ b/source/fitz/separation.c @@ -195,6 +195,8 @@ fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separatio return NULL; n = sep->num_separations; + if (n == 0) + return NULL; c = 0; for (i = 0; i < n; i++) { @@ -203,9 +205,10 @@ fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separatio c++; } - /* If no composites, then we are fine to render direct. */ + /* If no composites, then we don't need to create a new seps object + * with the composite ones enabled, so just reuse our current object. */ if (c == 0) - return NULL; + return fz_keep_separations(ctx, sep); /* We need to clone us a separation structure, with all * the composite separations marked as enabled. */ -- cgit v1.2.3