Fix for 687252 subfiledecode errors on includes greater than the size of a uint
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Fix for "687252 subfiledecode errors on includes greater than the
size of a uint". In spite of the bug name, the problem is not
related to the actual size of the subfile or to the size of a uint.
The actual problem is a missing required parameter: EODCount.
However Adobe once again ignores the missing parameter and what is
specified in the PRLM-3rd.
DETAILS:
The given test file has a SubFileDecode filter without the required
EODCount parameter.
Ghostscript is rejecting the test file because the parameter is not
defined. The RangeCheck error message is the result of the following
piece of code in zfilter.c:
if ((code = dict_int_param(op, "EODCount", 0, max_int, -1, &count)) < 0)
return code;
This sets a default value of -1 for EODCount and then checks it
against the range 0 to max_int. Thus when EODCount is not found
we get the rangecheck since -1 is outside the allowed range.
In spite of the fact that the EODCount is a required parameter, both
Adobe Distiller 6.0 and my CP1700PS printer print this file without
complaint.
Ghostscript can be made to also ignore the missing parameter by
simply changing the default value to 0:
Index: src/zfilter.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/zfilter.c,v
retrieving revision 1.9
diff -u -r1.9 zfilter.c
--- src/zfilter.c 16 Jan 2003 18:49:31 -0000 1.9
+++ src/zfilter.c 17 Jan 2004 00:38:13 -0000
@@ -146,7 +146,7 @@
int code;
check_dict_read(*op);
- if ((code = dict_int_param(op, "EODCount", 0, max_int, -1, &count))
< 0)
+ if ((code = dict_int_param(op, "EODCount", 0, max_int, 0, &count)) <
0)
return code;
if (dict_find_string(op, "EODString", &sop) <= 0)
return_error(e_rangecheck);
Dan