diff --git a/SDL/audio/xaudio2_7.c b/SDL/audio/xaudio2_7.c index fdce47f..6cc163d 100644 --- a/SDL/audio/xaudio2_7.c +++ b/SDL/audio/xaudio2_7.c @@ -38,7 +38,7 @@ static inline HRESULT XAudio2Create(IXAudio2 **ppXAudio2, if (SUCCEEDED(hr)) { *ppXAudio2 = pXAudio2; } - else { + else if (pXAudio2) { pXAudio2->lpVtbl->Release(pXAudio2); } return hr; @@ -132,4 +132,4 @@ static bool _audio_init(void) return true; } -GB_AUDIO_DRIVER(XAudio2_7); \ No newline at end of file +GB_AUDIO_DRIVER(XAudio2_7);