From de2314431f400a439cb2bcebb1152fc206b8804d Mon Sep 17 00:00:00 2001 From: Ray Johnston Date: Wed, 1 Feb 2017 19:46:29 -0800 Subject: Fix ignored return code for ICC profile device parameters. All of the uses of gx_default_put_icc_colorants and gx_default_put_icc ignored the return code which might be VMerror. Found when testing with multi-threaded rendering and low memory conditions. --- base/gsdparam.c | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/base/gsdparam.c b/base/gsdparam.c index 9c4740f4c..81053514d 100644 --- a/base/gsdparam.c +++ b/base/gsdparam.c @@ -1551,33 +1551,60 @@ nce: } /* Set the ICC output colors first */ if ((code = param_read_string(plist, "ICCOutputColors", &icc_pro)) != 1) { - gx_default_put_icc_colorants(&icc_pro, dev); + if ((code = gx_default_put_icc_colorants(&icc_pro, dev)) < 0) { + ecode = code; + param_signal_error(plist, "ICCOutputColors", ecode); + } } if ((code = param_read_string(plist, "OutputICCProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsDEFAULTPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsDEFAULTPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "OutputICCProfile", ecode); + } } /* Note, if a change is made to NUM_DEVICE_PROFILES we need to update this with the name of the profile */ if ((code = param_read_string(plist, "GraphicICCProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsGRAPHICPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsGRAPHICPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "GraphicICCProfile", ecode); + } } if ((code = param_read_string(plist, "ImageICCProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsIMAGEPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsIMAGEPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "ImageICCProfile", ecode); + } } if ((code = param_read_string(plist, "TextICCProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsTEXTPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsTEXTPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "TextICCProfile", ecode); + } } if ((code = param_read_string(plist, "ProofProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsPROOFPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsPROOFPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "ProofProfile", ecode); + } } if ((code = param_read_string(plist, "DeviceLinkProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsLINKPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsLINKPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "DeviceLinkProfile", ecode); + } } if ((code = param_read_string(plist, "PostRenderProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsPRPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsPRPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "PostRenderProfile", ecode); + } } if ((code = param_read_string(plist, "BlendColorProfile", &icc_pro)) != 1) { - gx_default_put_icc(&icc_pro, dev, gsBLENDPROFILE); + if ((code = gx_default_put_icc(&icc_pro, dev, gsBLENDPROFILE)) < 0) { + ecode = code; + param_signal_error(plist, "BlendColorProfile", ecode); + } } if ((code = param_read_int(plist, (param_name = "RenderIntent"), &(rend_intent[0]))) < 0) { -- cgit v1.2.1