Commit c5825b698db4648beff68fe082f754bdb8459c50

Ryan C. Gordon 2017-01-06T21:23:51

audio: Don't call a NULL function pointer when clearing audio streams. (Partially?) fixes Bugzilla #3547.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 58f763b..7bc3ffe 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -998,7 +998,9 @@ SDL_AudioStreamClear(SDL_AudioStream *stream)
         SDL_InvalidParamError("stream");
     } else {
         SDL_ClearDataQueue(stream->queue, stream->packetlen * 2);
-        stream->reset_resampler_func(stream);
+        if (stream->reset_resampler_func) {
+            stream->reset_resampler_func(stream);
+        }
     }
 }