Fixed build

This commit is contained in:
Sam Lantinga 2019-06-08 19:09:43 -07:00
parent 990e166a3b
commit a21b5b3018
2 changed files with 9 additions and 5 deletions

View File

@ -722,7 +722,7 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format
int paddingsamples;
float *padding;
if (requestedpadding < INT32_MAX / chans) {
if (requestedpadding < SDL_MAX_SINT32 / chans) {
paddingsamples = requestedpadding * chans;
} else {
paddingsamples = 0;
@ -899,9 +899,9 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
return SDL_SetError("Source rate is equal to or less than zero");
} else if (dst_rate <= 0) {
return SDL_SetError("Destination rate is equal to or less than zero");
} else if (src_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
} else if (src_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
return SDL_SetError("Source rate is too high");
} else if (dst_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
} else if (dst_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
return SDL_SetError("Destination rate is too high");
}

View File

@ -641,7 +641,9 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
size_t bytesleft, outputsize;
WaveChunk *chunk = &file->chunk;
ADPCM_DecoderState state = {0};
MS_ADPCM_ChannelState cstate[2] = {0};
MS_ADPCM_ChannelState cstate[2];
SDL_memset(cstate, 0, sizeof(cstate));
if (chunk->size != chunk->length) {
/* Could not read everything. Recalculate number of sample frames. */
@ -2075,7 +2077,9 @@ SDL_AudioSpec *
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
{
int result;
WaveFile file = {0};
WaveFile file;
SDL_zero(file);
/* Make sure we are passed a valid data source */
if (src == NULL) {