From 6a53ec4c209e94a56c01c3923777e4d84e895114 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 20 Feb 2023 09:31:31 +0000 Subject: [PATCH] Fix 8d6e5779: Use of ssize_t is problematic on Windows --- src/blitter/40bpp_anim.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blitter/40bpp_anim.cpp b/src/blitter/40bpp_anim.cpp index 97d532107b..862e21d3fb 100644 --- a/src/blitter/40bpp_anim.cpp +++ b/src/blitter/40bpp_anim.cpp @@ -43,9 +43,10 @@ void Blitter_40bppAnim::SetPixel32(void *video, int x, int y, uint8 colour, uint if (_screen_disable_anim) { Blitter_32bppOptimized::SetPixel32(video, x, y, colour, colour32); } else { - *((Colour *)video + x + y * _screen.pitch) = colour32; + size_t y_offset = static_cast(y) * _screen.pitch; + *((Colour *)video + x + y_offset) = colour32; - VideoDriver::GetInstance()->GetAnimBuffer()[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + (ssize_t)y * _screen.pitch] = 0; + VideoDriver::GetInstance()->GetAnimBuffer()[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y_offset] = 0; } }