diff --git a/ChangeLog b/ChangeLog index 290e058ad..633e782d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-05-16 Keith Packard + + * src/cairo-pattern.c: (_cairo_pattern_shader_init): + Initialize op->stops[0].scale = 0. + + This scale value is used only when computing gradient values + before the defined range, in which case stop 0 is used for both + ends of the interpolation, making the value of 'scale' not + actually matter, except that valgrind notices we're using + an undefined value. + 2005-05-16 Carl Worth * test/.cvsignore: diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 524ffa8bf..1746b6b2a 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -512,6 +512,13 @@ _cairo_pattern_shader_init (cairo_gradient_pattern_t *pattern, qsort (op->stops, pattern->n_stops, sizeof (cairo_shader_color_stop_t), _cairo_shader_color_stop_compare); + /* this scale value is used only when computing gradient values + * before the defined range, in which case stop 0 is used for both + * ends of the interpolation, making the value of 'scale' not + * actually matter, except that valgrind notices we're using + * an undefined value. + */ + op->stops[0].scale = 0; for (i = 0; i < pattern->n_stops - 1; i++) { op->stops[i + 1].scale = op->stops[i + 1].offset - op->stops[i].offset;