[gs-cvs] rev 8514 - trunk/gs/src
ray at ghostscript.com
ray at ghostscript.com
Thu Jan 31 14:20:33 PST 2008
Author: ray
Date: 2008-01-31 14:20:32 -0800 (Thu, 31 Jan 2008)
New Revision: 8514
Modified:
trunk/gs/src/gsdparam.c
Log:
Fix ColorValues parameter problem when device has total number of bits (depth)
of more than 31 bits, resulting in a "rangecheck" (-15) error.
DETAILS:
The default get_params would not return -1 for values too large for 32 bits,
but the default put_params tested for this. The rangecheck would show up
on 32-bit devices, such as tiff32nc when running:
"currentpagedevice setpagedevice"
Note that the value returned for ColorValues was platform dependent since
it previously set ColorValues to 1<<depth, but 1<<32 is not -1 on any
platform (that I know of).
Modified: trunk/gs/src/gsdparam.c
===================================================================
--- trunk/gs/src/gsdparam.c 2008-01-29 17:02:50 UTC (rev 8513)
+++ trunk/gs/src/gsdparam.c 2008-01-31 22:20:32 UTC (rev 8514)
@@ -174,8 +174,7 @@
if (colors > 1) {
int RGBValues = dev->color_info.max_color + 1;
- long ColorValues = (depth >= (8 * arch_sizeof_color_index) ? -1
- : 1L << depth);
+ long ColorValues = (depth >= 32 ? -1 : 1L << depth); /* value can only be 32 bits */
if ((code = param_write_int(plist, "RedValues", &RGBValues)) < 0 ||
(code = param_write_int(plist, "GreenValues", &RGBValues)) < 0 ||
More information about the gs-cvs
mailing list