1
0
Эх сурвалжийг харах

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).

Sam Lantinga 1 жил өмнө
parent
commit
f3b0149756
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/audio/SDL_wave.c

+ 1 - 1
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;