Browse Source

audio: Don't call a NULL function pointer when clearing audio streams.

(Partially?) fixes Bugzilla #3547.
Ryan C. Gordon 8 years ago
parent
commit
c5825b698d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/audio/SDL_audiocvt.c

+ 3 - 1
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);
+        }
     }
 }