Commit 8c37581d authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fixed a bug where a NULL primary buffer pointer is used when the

DirectSound object didn't create properly.
parent 369116d9
...@@ -716,6 +716,8 @@ static ULONG WINAPI IDirectSoundImpl_Release(LPDIRECTSOUND8 iface) { ...@@ -716,6 +716,8 @@ static ULONG WINAPI IDirectSoundImpl_Release(LPDIRECTSOUND8 iface) {
} }
RtlReleaseResource(&(This->lock)); RtlReleaseResource(&(This->lock));
if (This->primary)
IDirectSoundBuffer8_Release((LPDIRECTSOUNDBUFFER8)This->primary); IDirectSoundBuffer8_Release((LPDIRECTSOUNDBUFFER8)This->primary);
hres = DSOUND_PrimaryDestroy(This); hres = DSOUND_PrimaryDestroy(This);
...@@ -1112,6 +1114,8 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown ...@@ -1112,6 +1114,8 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
err = PrimaryBuffer_Create((*ippDS), (PrimaryBufferImpl**)&((*ippDS)->primary), &((*ippDS)->dsbd)); err = PrimaryBuffer_Create((*ippDS), (PrimaryBufferImpl**)&((*ippDS)->primary), &((*ippDS)->dsbd));
if ((*ippDS)->primary) if ((*ippDS)->primary)
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(*ippDS)->primary); IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(*ippDS)->primary);
else
WARN("PrimaryBuffer_Create failed\n");
return err; return err;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment