summaryrefslogtreecommitdiff
path: root/base/gdevmem.c
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2016-05-09 09:28:00 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2016-05-09 11:18:00 -0700
commitc4a33f573adbf8627f08407e4357475285b46cf0 (patch)
tree11a13983c844db9a14cdc71b2662274a4bef94ae /base/gdevmem.c
parentccd831b1b17b7e5f62e43583da51505d202b4de7 (diff)
downloadghostpdl-c4a33f573adbf8627f08407e4357475285b46cf0.tar.gz
Change max_components and num_components in dev.color_info to uchar
There are locations in the code where Coverity has complained about code logic that resulted in passing of unintialized values that could only occur if num_components < 0 . Since this should never be the case, we will make it clear by setting num_components and max_components to uchar. This will limit our support to 256 colors by a device.
Diffstat (limited to 'base/gdevmem.c')
-rw-r--r--base/gdevmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/gdevmem.c b/base/gdevmem.c
index d92d99484..41108bad6 100644
--- a/base/gdevmem.c
+++ b/base/gdevmem.c
@@ -182,7 +182,7 @@ gs_make_mem_device(gx_device_memory * dev, const gx_device_memory * mdproto,
}
if (dev->color_info.depth == 1) {
gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
- int k;
+ uchar k;
if (target != 0) {
for (k = 0; k < target->color_info.num_components; k++) {