From be40f6c4c1e7d728cf629c5ca06f1fdedb20af71 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Mon, 2 Oct 2017 22:02:44 +0100 Subject: [PATCH] Protect against nullptr dereference in SetConeOrientation --- src/CxbxKrnl/EmuDSoundInline.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/CxbxKrnl/EmuDSoundInline.hpp index 52ab82c14..d3be8e519 100644 --- a/src/CxbxKrnl/EmuDSoundInline.hpp +++ b/src/CxbxKrnl/EmuDSoundInline.hpp @@ -816,7 +816,10 @@ inline HRESULT HybridDirectSound3DBuffer_SetConeOrientation( enterCriticalSection; - HRESULT hRet = pDS3DBuffer->SetConeOrientation(x, y, z, dwApply); + HRESULT hRet = DS_OK; + if (pDS3DBuffer != nullptr) { + hRet = pDS3DBuffer->SetConeOrientation(x, y, z, dwApply); + } leaveCriticalSection;