From fd648ce8e59963aeb8fd47979e0d534bccbec30f Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 18 Aug 2024 10:37:09 +0200 Subject: [PATCH] fix vulnerability alert II. - use size_t for audioLength to fix the alert - use unsigned type to make the code more robust fixes #13 --- 3rdParty/SDL2_mixer/src/mixer.c | 2 +- 3rdParty/SDL2_mixer/src/types_internal.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdParty/SDL2_mixer/src/mixer.c b/3rdParty/SDL2_mixer/src/mixer.c index 1edb297a849..e6933e9bc27 100644 --- a/3rdParty/SDL2_mixer/src/mixer.c +++ b/3rdParty/SDL2_mixer/src/mixer.c @@ -829,7 +829,7 @@ Mix_Audio* Mix_LoadWAV_RW(Mix_RWops* src, SDL_bool stream) #ifdef FULL // SELF_CONV SDL_AudioCVT wavecvt; #endif - int audioLength; + size_t audioLength; #ifdef FULL // WAV_CHECK /* rcg06012001 Make sure src is valid */ if (!src) { diff --git a/3rdParty/SDL2_mixer/src/types_internal.h b/3rdParty/SDL2_mixer/src/types_internal.h index 1b4e9bddd9b..fcc175c6197 100644 --- a/3rdParty/SDL2_mixer/src/types_internal.h +++ b/3rdParty/SDL2_mixer/src/types_internal.h @@ -267,8 +267,8 @@ typedef struct { Sint64 samplesize; #endif #else - int start; - int stop; + unsigned start; + unsigned stop; #ifdef FULL // MUS_ENC, SEEK int samplesize; #endif @@ -323,7 +323,7 @@ typedef struct _Mix_Audio { int lastChannel; #ifndef FULL // SELF_CONV void (*converters[3])(Mix_BuffOps* buf); - int convMpl; + unsigned convMpl; #endif } _Mix_Audio; #endif // FULL - FIX_MUS