xaudio2: Protect access to submix voice during creation (Coverity).
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2c82e8b477
commit
7bb885a3d3
|
@ -1475,8 +1475,10 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
|
|||
EnterCriticalSection(&This->lock);
|
||||
|
||||
LIST_FOR_EACH_ENTRY(sub, &This->submix_voices, XA2SubmixImpl, entry){
|
||||
EnterCriticalSection(&sub->lock);
|
||||
if(!sub->in_use)
|
||||
break;
|
||||
LeaveCriticalSection(&sub->lock);
|
||||
}
|
||||
|
||||
if(&sub->entry == &This->submix_voices){
|
||||
|
@ -1498,11 +1500,14 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
|
|||
|
||||
InitializeCriticalSection(&sub->lock);
|
||||
sub->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2SubmixImpl.lock");
|
||||
|
||||
EnterCriticalSection(&sub->lock);
|
||||
}
|
||||
|
||||
sub->in_use = TRUE;
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
LeaveCriticalSection(&sub->lock);
|
||||
|
||||
#if XAUDIO2_VER == 0
|
||||
*ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio20SubmixVoice_iface;
|
||||
|
|
Loading…
Reference in New Issue