mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Fix NULL dereference in SDL_OpenAudio
This commit is contained in:

committed by
Ryan C. Gordon

parent
9a23d0e3f6
commit
39c2f97373
@@ -1672,10 +1672,12 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
|
||||
|
||||
if (!stream) {
|
||||
SDL_CloseAudioDevice(logdevid);
|
||||
} else if (SDL_BindAudioStream(logdevid, stream) == -1) {
|
||||
return NULL; // error string should already be set.
|
||||
}
|
||||
if (SDL_BindAudioStream(logdevid, stream) == -1) {
|
||||
SDL_DestroyAudioStream(stream);
|
||||
SDL_CloseAudioDevice(logdevid);
|
||||
stream = NULL;
|
||||
return NULL; // error string should already be set.
|
||||
}
|
||||
|
||||
logdev->simplified = SDL_TRUE; // forbid further binding changes on this logical device.
|
||||
|
Reference in New Issue
Block a user