From d9b8e829a5908bfd30166ef352d6dc162b807810 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 8 Jul 2022 14:17:28 +0300 Subject: [PATCH] Fix crash on Windows 8.x --- SDL/audio/xaudio2_7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);