gdiplus: Check whether region path points really fit into shorts.
This commit is contained in:
parent
761391f156
commit
56a6500721
|
@ -96,8 +96,10 @@ static BOOL is_integer_path(const GpPath *path)
|
|||
|
||||
for (i = 0; i < path->pathdata.Count; i++)
|
||||
{
|
||||
if (path->pathdata.Points[i].X != gdip_round(path->pathdata.Points[i].X) ||
|
||||
path->pathdata.Points[i].Y != gdip_round(path->pathdata.Points[i].Y))
|
||||
short x, y;
|
||||
x = gdip_round(path->pathdata.Points[i].X);
|
||||
y = gdip_round(path->pathdata.Points[i].Y);
|
||||
if (path->pathdata.Points[i].X != (REAL)x || path->pathdata.Points[i].Y != (REAL)y)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -617,44 +617,30 @@ static void test_getregiondata(void)
|
|||
needed = 0;
|
||||
status = GdipGetRegionDataSize(region, &needed);
|
||||
ok(status == Ok, "status %08x\n", status);
|
||||
todo_wine
|
||||
expect(72, needed);
|
||||
memset(buf, 0xee, sizeof(buf));
|
||||
needed = 0;
|
||||
status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed);
|
||||
ok(status == Ok, "status %08x\n", status);
|
||||
todo_wine
|
||||
expect(72, needed);
|
||||
todo_wine
|
||||
expect_dword(buf, 64);
|
||||
trace("buf[1] = %08x\n", buf[1]);
|
||||
expect_magic(buf + 2);
|
||||
expect_dword(buf + 3, 0);
|
||||
expect_dword(buf + 4, RGNDATA_PATH);
|
||||
todo_wine
|
||||
expect_dword(buf + 5, 48);
|
||||
expect_magic(buf + 6);
|
||||
expect_dword(buf + 7, 4);
|
||||
/* flags 0 means that a path is an array of FLOATs */
|
||||
todo_wine
|
||||
expect_dword(buf + 8, 0);
|
||||
todo_wine
|
||||
expect_float(buf + 9, -196900.0);
|
||||
todo_wine
|
||||
expect_float(buf + 10, -197400.0);
|
||||
todo_wine
|
||||
expect_float(buf + 11, 2600.0);
|
||||
todo_wine
|
||||
expect_float(buf + 12, -197400.0);
|
||||
todo_wine
|
||||
expect_float(buf + 13, 2600.0);
|
||||
todo_wine
|
||||
expect_float(buf + 14, 2300.0);
|
||||
todo_wine
|
||||
expect_float(buf + 15, -196900.0);
|
||||
todo_wine
|
||||
expect_float(buf + 16, 2300.0);
|
||||
todo_wine
|
||||
expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */
|
||||
|
||||
status = GdipDeletePath(path);
|
||||
|
|
Loading…
Reference in New Issue