[PATCH] gdiplus: Avoid negative integer overflow due to implicit type conversion.
Signed-off-by: Haoyang Chen <chenhaoyang(a)uniontech.com> --- 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) { -- 2.20.1
participants (2)
-
Esme Povirk (they/them) -
Haoyang Chen