[gs-cvs] rev 8173 - trunk/gs/src

tim at ghostscript.com tim at ghostscript.com
Fri Aug 3 09:29:44 PDT 2007


Author: tim
Date: 2007-08-03 09:29:44 -0700 (Fri, 03 Aug 2007)
New Revision: 8173

Modified:
   trunk/gs/src/siscale.c
Log:
Fix for seg fault caused by undersized buffer as reported in bug report #687397

DETAILS:

Although the patch submitted by the reporter did appear to fix the problem,
it was more masking it than fixing it. While the analysis of the problem
being that ss->Items was too small was correct, the real cause was a rounding
problem in siscale.c/contrib_pixels(). The problem did not happen on my Mac,
but was reproduced up on peeves because of differnces in the way the two
systems perform rounding.

EXPECTED DIFFERENCES:

None



Modified: trunk/gs/src/siscale.c
===================================================================
--- trunk/gs/src/siscale.c	2007-08-03 15:46:03 UTC (rev 8172)
+++ trunk/gs/src/siscale.c	2007-08-03 16:29:44 UTC (rev 8173)
@@ -179,7 +179,7 @@
 contrib_pixels(double scale)
 {
     return (int)(fWidthIn / (scale >= 1.0 ? 1.0 : max(scale, min_scale))
-		 * 2 + 1);
+		 * 2 + 1.5);
 }
 
 /* Pre-calculate filter contributions for a row or a column. */



More information about the gs-cvs mailing list