Commit 331a7af3 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Fix a possible floating point exception in path gradients.

parent 4a70f67f
......@@ -1493,9 +1493,18 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
REAL blend_amount, pdy, pdx;
pdy = yf - center_point.Y;
pdx = xf - center_point.X;
if (fabs(pdx) <= 0.001 && fabs(pdy) <= 0.001)
{
/* Too close to center point, don't try to calculate outer color */
outer_color = start_color;
}
else
{
blend_amount = ( (center_point.Y - start_point.Y) * pdx + (start_point.X - center_point.X) * pdy ) / ( dy * pdx - dx * pdy );
outer_color = blend_colors(start_color, end_color, blend_amount);
}
}
distance = (end_point.Y - start_point.Y) * (start_point.X - xf) +
(end_point.X - start_point.X) * (yf - start_point.Y);
......
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