Fixed a bug where a NULL primary buffer pointer is used when the
DirectSound object didn't create properly.
This commit is contained in:
parent
369116d911
commit
8c37581dd7
|
@ -716,7 +716,9 @@ static ULONG WINAPI IDirectSoundImpl_Release(LPDIRECTSOUND8 iface) {
|
|||
}
|
||||
|
||||
RtlReleaseResource(&(This->lock));
|
||||
IDirectSoundBuffer8_Release((LPDIRECTSOUNDBUFFER8)This->primary);
|
||||
|
||||
if (This->primary)
|
||||
IDirectSoundBuffer8_Release((LPDIRECTSOUNDBUFFER8)This->primary);
|
||||
|
||||
hres = DSOUND_PrimaryDestroy(This);
|
||||
if (hres != DS_OK)
|
||||
|
@ -1112,6 +1114,8 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
|
|||
err = PrimaryBuffer_Create((*ippDS), (PrimaryBufferImpl**)&((*ippDS)->primary), &((*ippDS)->dsbd));
|
||||
if ((*ippDS)->primary)
|
||||
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(*ippDS)->primary);
|
||||
else
|
||||
WARN("PrimaryBuffer_Create failed\n");
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue