summaryrefslogtreecommitdiff
path: root/base/gscdevn.c
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2017-06-29 11:20:09 +0100
committerChris Liddell <chris.liddell@artifex.com>2017-06-30 14:08:55 +0100
commit0b7fa9293f43dce8aea028e4d2b32da1d8fc18c8 (patch)
treec23031e84ab58a1826067da0ce4b46396b1bb231 /base/gscdevn.c
parentd592ee18a9168b1190bc7f7a1426b41fa6d508af (diff)
downloadghostpdl-0b7fa9293f43dce8aea028e4d2b32da1d8fc18c8.tar.gz
Add error checking for gs_colorspace_set_icc_equivalent()
Diffstat (limited to 'base/gscdevn.c')
-rw-r--r--base/gscdevn.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/base/gscdevn.c b/base/gscdevn.c
index cc2e5e51c..6b8108ec9 100644
--- a/base/gscdevn.c
+++ b/base/gscdevn.c
@@ -353,7 +353,7 @@ gx_concrete_space_DeviceN(const gs_color_space * pcs,
/* Need to handle PS CIE space */
if (gs_color_space_is_PSCIE(pcs->base_space)) {
if (pcs->base_space->icc_equivalent == NULL) {
- gs_colorspace_set_icc_equivalent(pcs->base_space,
+ (void)gs_colorspace_set_icc_equivalent(pcs->base_space,
&is_lab, pgs->memory);
}
return (pcs->base_space->icc_equivalent);
@@ -469,13 +469,16 @@ gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
rescale_cie_colors(pacs, &cc);
/* If we have not yet created the profile do that now */
if (pacs->icc_equivalent == NULL) {
- gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pgs->memory);
+ code = gs_colorspace_set_icc_equivalent(pacs, &(is_lab), pgs->memory);
+ if (code < 0)
+ return code;
}
/* Use the ICC equivalent color space */
pacs = pacs->icc_equivalent;
}
- if (pacs->cmm_icc_profile_data->data_cs == gsCIELAB ||
- pacs->cmm_icc_profile_data->islab) {
+ if (pacs->cmm_icc_profile_data &&
+ (pacs->cmm_icc_profile_data->data_cs == gsCIELAB ||
+ pacs->cmm_icc_profile_data->islab)) {
/* Get the data in a form that is concrete for the CMM */
cc.paint.values[0] /= 100.0;
cc.paint.values[1] = (cc.paint.values[1]+128)/255.0;