Fix : an access to uninitialized data.
"Igor V. Melichev" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
[Log message beg]
Fix : an access to uninitialized data.
DETAILS :
1. pcpath->path_list was not reset when it is replaced with a rectangle.
Bug 687178 "Infinite loop in ialloc_validate_memory".
2. Type 11 fonts got an occasional indeterministic data to pdata->Encoding,
which were inaccurately checked for r_size() <= 256.
EXPECTED DIFFERENCES :
I did not detected any difference on Windows,
but I believe that the old code was indeterministic.
[Log message end]
Changes:
*** f:\casper\HEAD\gs\src\gxcpath.c Fri Nov 14 01:27:27 2003
--- files\gs\src\gxcpath.c Thu Dec 4 02:49:04 2003
***************
*** 586,589 ****
--- 586,590 ----
/* Release the existing path. */
rc_decrement(pcpath->path_list, "gx_cpath_intersect");
+ pcpath->path_list = NULL;
gx_path_new(&pcpath->path);
ppath->bbox = new_box;
*** f:\casper\HEAD\gs\src\zbfont.c Sat Nov 1 01:12:43 2003
--- files\gs\src\zbfont.c Thu Dec 4 03:49:22 2003
***************
*** 448,457 ****
{
const ref *pfe = &pfont_data(pfont)->Encoding;
- uint esize = r_size(pfe);
int index = -1;
pfont->encoding_index = index;
! if (esize <= 256) {
/* Look for an encoding that's "close". */
int near_index = -1;
uint best = esize / 3; /* must match at least this many */
--- 448,457 ----
{
const ref *pfe = &pfont_data(pfont)->Encoding;
int index = -1;
pfont->encoding_index = index;
! if (r_type(pfe) == t_array && r_size(pfe) <= 256) {
/* Look for an encoding that's "close". */
+ uint esize = r_size(pfe);
int near_index = -1;
uint best = esize / 3; /* must match at least this many */
***************
*** 567,570 ****
--- 567,571 ----
if (!(options & bf_Encoding_optional))
return_error(e_invalidfont);
+ pencoding = 0;
} else {
if (!r_is_array(pencoding))