mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
audio: Make sure we don't write to a NULL pointer.
(This _probably_ never happens in the current codebase, but just in case.)
This commit is contained in:
@@ -1119,7 +1119,9 @@ int SDL_ClearAudioStream(SDL_AudioStream *stream)
|
||||
|
||||
SDL_LockMutex(stream->lock);
|
||||
SDL_ClearDataQueue(stream->queue, (size_t)stream->packetlen * 2);
|
||||
SDL_memset(stream->history_buffer, SDL_GetSilenceValueForFormat(stream->src_spec.format), stream->history_buffer_frames * stream->src_spec.channels * sizeof (float));
|
||||
if (stream->history_buffer != NULL) {
|
||||
SDL_memset(stream->history_buffer, SDL_GetSilenceValueForFormat(stream->src_spec.format), stream->history_buffer_frames * stream->src_spec.channels * sizeof (float));
|
||||
}
|
||||
stream->future_buffer_filled_frames = 0;
|
||||
stream->flushed = SDL_FALSE;
|
||||
SDL_UnlockMutex(stream->lock);
|
||||
|
Reference in New Issue
Block a user