Commit b8e83c94 authored by Martin Nordholts's avatar Martin Nordholts

Bug 551864 – plugin Flame fails for some settings on 64bit

machines

* plug-ins/flame/rect.c (render_rectangle): To handle p[0] and
p[1] being NaN, make sure that they are "within bounds" instead of
"not outside bounds".

svn path=/trunk/; revision=27067
parent 30eaab08
2008-09-27 Martin Nordholts <martinn@svn.gnome.org>
Bug 551864 – plugin Flame fails for some settings on 64bit
machines
* plug-ins/flame/rect.c (render_rectangle): To handle p[0] and
p[1] being NaN, make sure that they are "within bounds" instead of
"not outside bounds".
2008-09-26 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpnavigationview.c: reorder functions and add
......
......@@ -274,23 +274,32 @@ render_rectangle (frame_spec *spec,
int k, color_index;
double *p = points[j];
bucket *b;
if (p[0] < bounds[0] ||
p[1] < bounds[1] ||
p[0] > bounds[2] ||
p[1] > bounds[3])
continue;
/* Note that we must test if p[0] and p[1] is "within"
* the valid bounds rather than "not outside", because
* p[0] and p[1] might be NaN.
*/
if (p[0] >= bounds[0] &&
p[1] >= bounds[1] &&
p[0] <= bounds[2] &&
p[1] <= bounds[3])
{
color_index = (int) (p[2] * CMAP_SIZE);
if (color_index < 0)
color_index = 0;
else if (color_index > (CMAP_SIZE-1))
color_index = CMAP_SIZE-1;
else if (color_index > CMAP_SIZE - 1)
color_index = CMAP_SIZE - 1;
b = buckets +
(int) (width * (p[0] - bounds[0]) * size[0]) +
width * (int) (height * (p[1] - bounds[1]) * size[1]);
for (k = 0; k < 4; k++)
bump_no_overflow(b[0][k], cmap[color_index][k], short);
}
}
}
if (1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment