Commit e98920f5f31db12aaaadbdc59508245328a442ae

Ryan C. Gordon 2017-10-18T23:49:46

Check correct variable for malloc() results.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 5bc7016..3a10fc9 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -1299,7 +1299,7 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format,
     retval->staging_buffer_size = ((retval->resampler_padding_samples / retval->pre_resample_channels) * retval->src_sample_frame_size);
     if (retval->staging_buffer_size > 0) {
         retval->staging_buffer = (Uint8 *) SDL_malloc(retval->staging_buffer_size);
-        if (retval->resampler_padding == NULL) {
+        if (retval->staging_buffer == NULL) {
             SDL_FreeAudioStream(retval);
             SDL_OutOfMemory();
             return NULL;