1.1 --- a/src/audio/SDL_audiocvt.c Sat Jun 08 19:02:42 2019 -0700
1.2 +++ b/src/audio/SDL_audiocvt.c Sat Jun 08 19:09:43 2019 -0700
1.3 @@ -722,7 +722,7 @@
1.4 int paddingsamples;
1.5 float *padding;
1.6
1.7 - if (requestedpadding < INT32_MAX / chans) {
1.8 + if (requestedpadding < SDL_MAX_SINT32 / chans) {
1.9 paddingsamples = requestedpadding * chans;
1.10 } else {
1.11 paddingsamples = 0;
1.12 @@ -899,9 +899,9 @@
1.13 return SDL_SetError("Source rate is equal to or less than zero");
1.14 } else if (dst_rate <= 0) {
1.15 return SDL_SetError("Destination rate is equal to or less than zero");
1.16 - } else if (src_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
1.17 + } else if (src_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
1.18 return SDL_SetError("Source rate is too high");
1.19 - } else if (dst_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
1.20 + } else if (dst_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
1.21 return SDL_SetError("Destination rate is too high");
1.22 }
1.23
2.1 --- a/src/audio/SDL_wave.c Sat Jun 08 19:02:42 2019 -0700
2.2 +++ b/src/audio/SDL_wave.c Sat Jun 08 19:09:43 2019 -0700
2.3 @@ -641,7 +641,9 @@
2.4 size_t bytesleft, outputsize;
2.5 WaveChunk *chunk = &file->chunk;
2.6 ADPCM_DecoderState state = {0};
2.7 - MS_ADPCM_ChannelState cstate[2] = {0};
2.8 + MS_ADPCM_ChannelState cstate[2];
2.9 +
2.10 + SDL_memset(cstate, 0, sizeof(cstate));
2.11
2.12 if (chunk->size != chunk->length) {
2.13 /* Could not read everything. Recalculate number of sample frames. */
2.14 @@ -2075,7 +2077,9 @@
2.15 SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
2.16 {
2.17 int result;
2.18 - WaveFile file = {0};
2.19 + WaveFile file;
2.20 +
2.21 + SDL_zero(file);
2.22
2.23 /* Make sure we are passed a valid data source */
2.24 if (src == NULL) {