[4/4] gdiplus: Check whether region path points really fit into shorts.

Dmitry Timoshkov dmitry at baikal.ru
Tue Nov 12 23:00:30 CST 2013


---
 dlls/gdiplus/region.c       |  6 ++++--
 dlls/gdiplus/tests/region.c | 14 --------------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index 0295e62..5d95fcd 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -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;
diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c
index 77fb4fe..2b4f148 100644
--- a/dlls/gdiplus/tests/region.c
+++ b/dlls/gdiplus/tests/region.c
@@ -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);
-- 
1.8.4.2




More information about the wine-patches mailing list