From f3b0149756207e3af18ea3036184b681ff9bd0bd Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 4 Dec 2023 19:30:01 -0800 Subject: [PATCH] Fixed warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2). --- src/audio/SDL_wave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index cb3732305d..1af3b97e1b 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -985,7 +985,7 @@ static int IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) const size_t remainingbytes = blockleft % subblockframesize; blockframesleft = guaranteedframes; if (remainingbytes > subblockframesize - 4) { - blockframesleft += (remainingbytes % 4) * 2; + blockframesleft += (Sint64)(remainingbytes % 4) * 2; } /* Signal the truncation. */ retval = -1;