Haoyang Chen : gdiplus: Avoid negative integer overflow due to implicit type conversion.

Alexandre Julliard julliard at winehq.org
Mon Feb 1 16:13:07 CST 2021


Module: wine
Branch: master
Commit: 4c4a5cb799f54326941f5d38eafef908867271dd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4c4a5cb799f54326941f5d38eafef908867271dd

Author: Haoyang Chen <chenhaoyang at uniontech.com>
Date:   Fri Jan 29 18:08:20 2021 +0800

gdiplus: Avoid negative integer overflow due to implicit type conversion.

Signed-off-by: Haoyang Chen <chenhaoyang at uniontech.com>
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/graphics.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 2e6c0d7c9c8..7b4794e3620 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -972,9 +972,9 @@ static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT wi
     {
         /* Tiling. Make sure co-ordinates are positive as it simplifies the math. */
         if (x < 0)
-            x = width*2 + x % (width * 2);
+            x = width*2 + x % (INT)(width * 2);
         if (y < 0)
-            y = height*2 + y % (height * 2);
+            y = height*2 + y % (INT)(height * 2);
 
         if (attributes->wrap & WrapModeTileFlipX)
         {




More information about the wine-cvs mailing list