Skip to content

Commit

Permalink
Fixed crash if the WASAPI audio device couldn't be recovered
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 28, 2017
1 parent 4a73420 commit 77ca0f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/audio/wasapi/SDL_wasapi.c
Expand Up @@ -372,7 +372,8 @@ WASAPI_GetPendingBytes(_THIS)
UINT32 frames = 0;

/* it's okay to fail here; we'll deal with failures in the audio thread. */
if (FAILED(IAudioClient_GetCurrentPadding(this->hidden->client, &frames))) {
/* FIXME: need a lock around checking this->hidden->client */
if (!this->hidden->client || FAILED(IAudioClient_GetCurrentPadding(this->hidden->client, &frames))) {
return 0; /* oh well. */
}

Expand Down

0 comments on commit 77ca0f2

Please sign in to comment.