summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2012-08-02 23:14:09 -0700
committerChris Liddell <chris.liddell@artifex.com>2012-08-07 11:45:54 +0100
commite48e87f883df0d39d1409d814c5d15444c3dca07 (patch)
treef90c1d9f7e168f884dee2f0cb2f62ba6d4307486
parent588c2ee040526fbea470e36e7cbc8e87a503cab9 (diff)
downloadghostpdl-e48e87f883df0d39d1409d814c5d15444c3dca07.tar.gz
Bug 693185. The limitcheck in validatedevicenspace must match int_remap_color_info_s.
Commit e884e3 masked the failure, but since the test in validatedevicenspace used GS_CLIENT_COLOR_MAX_COMPONENTS, the array bounds could still be exceeded. Note that the confusing error message from the PDF interpreter from comment 1 still exists unless -dPDFSTOPONERROR is used, which gives a more meaningful 'limitcheck' immediately following the 'Do' of the image with 17 DeviceN components. Bug 693185 is reopened for the error message as P3.
-rw-r--r--gs/base/gsccolor.h2
-rw-r--r--gs/psi/icremap.h2
-rw-r--r--gs/psi/zcolor.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/gs/base/gsccolor.h b/gs/base/gsccolor.h
index e16d3ce5e..23c9ca810 100644
--- a/gs/base/gsccolor.h
+++ b/gs/base/gsccolor.h
@@ -40,7 +40,7 @@ typedef struct gs_pattern_instance_s gs_pattern_instance_t;
#endif
#ifndef MAX_COMPONENTS_IN_DEVN
-# define MAX_COMPONENTS_IN_DEVN (32)
+# define MAX_COMPONENTS_IN_DEVN (64)
#endif
/* There is a speed penalty for supporting lots of spot colors, so certain
diff --git a/gs/psi/icremap.h b/gs/psi/icremap.h
index c3b254ed3..58a495d39 100644
--- a/gs/psi/icremap.h
+++ b/gs/psi/icremap.h
@@ -32,7 +32,7 @@ typedef struct int_remap_color_info_s int_remap_color_info_t;
#endif
struct int_remap_color_info_s {
op_proc_t proc; /* remapping procedure */
- float tint[MAX_COMPONENTS_IN_DEVN];
+ float tint[MAX_COMPONENTS_IN_DEVN]; /* must match limitcheck in psi/zcolor.c: validatedevicenspace */
};
#define private_st_int_remap_color_info() /* in zgstate.c */\
diff --git a/gs/psi/zcolor.c b/gs/psi/zcolor.c
index 728123052..0f5be544b 100644
--- a/gs/psi/zcolor.c
+++ b/gs/psi/zcolor.c
@@ -4065,7 +4065,7 @@ static int validatedevicenspace(i_ctx_t * i_ctx_p, ref **space)
if (r_size(&namesarray) < 1)
return_error(e_typecheck);
/* Make sure no more inks than we can cope with */
- if (r_size(&namesarray) > GS_CLIENT_COLOR_MAX_COMPONENTS)
+ if (r_size(&namesarray) > MAX_COMPONENTS_IN_DEVN) /* MUST match psi/icremap.h int_remap_color_info_s */
return_error(e_limitcheck);
/* Check the tint transform is a procedure */
code = array_get(imemory, devicenspace, 3, &proc);