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,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;
}
......
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