summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2017-02-01 19:46:29 -0800
committerRay Johnston <ray.johnston@artifex.com>2017-02-01 19:57:54 -0800
commitde2314431f400a439cb2bcebb1152fc206b8804d (patch)
treeaec9c1221da7898126325c2b7c24b421e1357c5d
parentcead170cb9e8dc25e59e3c8d7d8616d8b2f7119a (diff)
downloadghostpdl-de2314431f400a439cb2bcebb1152fc206b8804d.tar.gz
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.
-rw-r--r--base/gsdparam.c45
1 files 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) {