Skip to content

Commit

Permalink
fix vulnerability alert II.
Browse files Browse the repository at this point in the history
- use size_t for audioLength to fix the alert
- use unsigned type to make the code more robust

fixes #13
  • Loading branch information
pionere committed Aug 18, 2024
1 parent 551e1ae commit fd648ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 3rdParty/SDL2_mixer/src/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions 3rdParty/SDL2_mixer/src/types_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fd648ce

Please sign in to comment.