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

Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Haoyang Chen 2021-01-29 18:08:20 +08:00 committed by Alexandre Julliard
parent 47ac628b4a
commit 4c4a5cb799
1 changed files with 2 additions and 2 deletions

View File

@ -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)
{