Re: Fix for 687252 subfiledecode errors on includesgreater than the size of a uint

"Igor V. Melichev" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
CPSI 3010.105 passed the test file.
The change looks good, but I would add a comment into the code :

/* Adobe interprets a missed EODCount as 0, see bug 687252. */

Igor.

----- Original Message ----- 
From: "Dan Coby" <[email protected]>
To: "Gs-Code-Review" <[email protected]>
Sent: Saturday, January 17, 2004 3:54 AM
Subject: [gs-code-review] Fix for 687252 subfiledecode errors on
includesgreater than the size of a uint


> 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
>
> _______________________________________________
> gs-code-review mailing list
> [email protected]
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.