From 2be51ed491ede636c71ee0e0ae0ee2576d9e9561 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 23 Nov 2017 11:01:22 +0000 Subject: Update fz_convert_separation_colors to cope with unnamed separations. Well, at least not to crash. --- source/fitz/separation.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/fitz/separation.c b/source/fitz/separation.c index ee3c35c7..fe1530a7 100644 --- a/source/fitz/separation.c +++ b/source/fitz/separation.c @@ -985,6 +985,8 @@ void fz_convert_separation_colors(fz_context *ctx, const fz_color_params *color_ { const char *name = fz_colorspace_colorant(ctx, src_cs, i); + if (name == NULL) + continue; if (i == 0 && !strcmp(name, "All")) { /* This is only supposed to happen in separation spaces, not DeviceN */ @@ -1002,19 +1004,19 @@ void fz_convert_separation_colors(fz_context *ctx, const fz_color_params *color_ for (j = pred; j < ds; j++) { const char *dname = dst_seps->name[j]; - if (!strcmp(name, dname)) + if (dname && !strcmp(name, dname)) goto found_sep; } for (j = 0; j < pred; j++) { const char *dname = dst_seps->name[j]; - if (!strcmp(name, dname)) + if (dname && !strcmp(name, dname)) goto found_sep; } for (j = 0; j < dc; j++) { const char *dname = fz_colorspace_colorant(ctx, dst_cs, j); - if (!strcmp(name, dname)) + if (dname && !strcmp(name, dname)) goto found_process; } if (0) { -- cgit v1.2.3