Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 9, 2019
1 parent 990e166 commit a21b5b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/audio/SDL_audiocvt.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down
8 changes: 6 additions & 2 deletions src/audio/SDL_wave.c
Expand Up @@ -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. */
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a21b5b3

Please sign in to comment.