quartz: Check allocation failure and clear memory in DSound Renderer.

This commit is contained in:
Chris Robinson 2007-03-09 05:47:37 -08:00 committed by Alexandre Julliard
parent 08670ee725
commit e44a0d6d4d
1 changed files with 9 additions and 4 deletions

View File

@ -316,18 +316,23 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
return CLASS_E_NOAGGREGATION;
pDSoundRender = CoTaskMemAlloc(sizeof(DSoundRenderImpl));
if (!pDSoundRender)
return E_OUTOFMEMORY;
ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl));
pDSoundRender->lpVtbl = &DSoundRender_Vtbl;
pDSoundRender->IBasicAudio_vtbl = &IBasicAudio_Vtbl;
pDSoundRender->refCount = 1;
InitializeCriticalSection(&pDSoundRender->csFilter);
pDSoundRender->state = State_Stopped;
pDSoundRender->pClock = NULL;
pDSoundRender->init = FALSE;
pDSoundRender->started = FALSE;
ZeroMemory(&pDSoundRender->filterInfo, sizeof(FILTER_INFO));
pDSoundRender->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
if (!pDSoundRender->ppPins)
{
DeleteCriticalSection(&pDSoundRender->csFilter);
CoTaskMemFree(pDSoundRender);
return E_OUTOFMEMORY;
}
/* construct input pin */
piInput.dir = PINDIR_INPUT;