gdiplus: Avoid infinite recursion in flatten_bezier().

If either of the recursive calls would have the same x2, y2, x3, and y3
arguments as the current call, the path is as flat as the precision of floats
allows.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2017-04-24 13:16:08 -05:00 committed by Alexandre Julliard
parent 5ff2fdc452
commit a3f0a59132
1 changed files with 4 additions and 0 deletions

View File

@ -142,6 +142,10 @@ static BOOL flatten_bezier(path_list_node_t *start, REAL x2, REAL y2, REAL x3, R
mp[2].X = (mp[1].X + mp[3].X) / 2.0;
mp[2].Y = (mp[1].Y + mp[3].Y) / 2.0;
if ((x2 == mp[0].X && y2 == mp[0].Y && x3 == mp[1].X && y3 == mp[1].Y) ||
(x2 == mp[3].X && y2 == mp[3].Y && x3 == mp[4].X && y3 == mp[4].Y))
return TRUE;
pt = end->pt;
pt_st = start->pt;
/* check flatness as a half of distance between middle point and a linearized path */