Patch to cure recursion by aborting if the co-ordinates are to big to handle (jburgess)

This commit is contained in:
Artem Pavlenko 2009-03-31 19:50:55 +00:00
parent 1a03c2d655
commit 946fa51f4f

View file

@ -323,6 +323,12 @@ namespace agg
{
int cx = (x1 + x2) >> 1;
int cy = (y1 + y2) >> 1;
// Bail if values are so large they are likely to wrap
if ((abs(x1) >= INT_MAX/2) || (abs(y1) >= INT_MAX/2) ||
(abs(x2) >= INT_MAX/2) || (abs(y2) >= INT_MAX/2))
return;
line(x1, y1, cx, cy);
line(cx, cy, x2, y2);
}