RE: Partial fix for 687029, Different results on Alpha, part 4
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Alex, Do you have a test file for this situation? I do not have a test file for this problem so the fix is a little difficult to verify. Changing the cache rmin and rmax makes me nervous. However I cannot find a specific problem. Dan -----Original Message----- From: Igor V. Melichev [mailto:[email protected]] Sent: Tuesday, November 25, 2003 12:21 AM To: '[email protected]'; gs-code-review; Alex Cherepanov Subject: Re: [gs-code-review] Partial fix for 687029, Different results on Alpha, part 4 This patch is out my area. Dan, please review it. Igor. ----- Original Message ----- From: "Alex Cherepanov" <[email protected]> To: "gs-code-review" <[email protected]> Sent: Tuesday, November 25, 2003 4:20 AM Subject: [gs-code-review] Partial fix for 687029, Different results on Alpha, part 4 > Avoid division by 0. Don't interpolate constant functions. > > ---------------------------------------------------------------------------- ---- > Index: gs/src/gscie.c > =================================================================== > RCS file: /cvs/ghostscript/gs/src/gscie.c,v > retrieving revision 1.13 > diff -b -u -r1.13 gscie.c > --- gs/src/gscie.c 16 Jun 2002 05:48:55 -0000 1.13 > +++ gs/src/gscie.c 24 Nov 2003 23:36:45 -0000 > @@ -589,6 +589,15 @@ > cie_cache_range_temp_t temp[3]; > int i, j; > > + if (factor == 0) { > + /* Disable interpolation by setting an empty range. */ > + for (j = 0; j < 3; ++j) { > + pcache->vecs.params.interpolation_ranges[j].rmin = 0; > + pcache->vecs.params.interpolation_ranges[j].rmax = -1; > + } > + return; > + } > + > for (j = 0; j < 3; ++j) > temp[j].imin = gx_cie_cache_size, temp[j].imax = -1; > temp[0].prev = pcache->vecs.values[0].u; > @@ -630,9 +639,8 @@ > > pcache->vecs.params.base = float2cie_cached(pcf->params.base); > pcache->vecs.params.factor = float2cie_cached(pcf->params.factor); > - pcache->vecs.params.limit = > - float2cie_cached((gx_cie_cache_size - 1) / pcf->params.factor + > - pcf->params.base); > + pcache->vecs.params.limit = float2cie_cached( (pcf->params.factor == 0 ? 0 : > + (gx_cie_cache_size - 1) / pcf->params.factor) + pcf->params.base); > for (i = 0; i < gx_cie_cache_size; ++i) { > float f = pcf->values[i]; > > ---------------------------------------------------------------------------- ---- > _______________________________________________ > gs-code-review mailing list > [email protected] > http://www.ghostscript.com/mailman/listinfo/gs-code-review >