mi: Integer overflow for dashed lines longer than 46340. #31093

Lines of length greater than 46340 can be drawn with one of the
coordinates being negative. However for dashed lines, miPolyBuildPoly
overflows the int type when setting up edges for a section of the
dashed line. This results in the dashed segments not being drawn at
all.

Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Siddhesh Poyarekar 2010-10-26 09:11:53 +05:30 committed by Keith Packard
parent a6c64d9645
commit be7cf14c36

View File

@ -403,7 +403,7 @@ miPolyBuildPoly (
i = top;
j = StepAround (top, -1, count);
if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx)
if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx)
{
clockwise = -1;
slopeoff = -1;