Commit d1197ffa authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Leave critical section on error in MediaStreamFilter::EnumPins().

parent 48c3a306
......@@ -361,14 +361,14 @@ static HRESULT WINAPI filter_EnumPins(IMediaStreamFilter *iface, IEnumPins **enu
TRACE("iface %p, enum_pins %p.\n", iface, enum_pins);
EnterCriticalSection(&filter->cs);
if (!enum_pins)
return E_POINTER;
if (!(object = heap_alloc(sizeof(*object))))
return E_OUTOFMEMORY;
EnterCriticalSection(&filter->cs);
object->IEnumPins_iface.lpVtbl = &enum_pins_vtbl;
object->refcount = 1;
object->count = filter->nb_streams;
......@@ -376,6 +376,7 @@ static HRESULT WINAPI filter_EnumPins(IMediaStreamFilter *iface, IEnumPins **enu
if (!(object->pins = heap_alloc(filter->nb_streams * sizeof(*object->pins))))
{
heap_free(object);
LeaveCriticalSection(&filter->cs);
return E_OUTOFMEMORY;
}
for (i = 0; i < filter->nb_streams; ++i)
......
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