amstream: Leave critical section on error in MediaStreamFilter::EnumPins().
Signed-off-by: Anton Baskanov <baskanov@gmail.com> Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
48c3a30650
commit
d1197ffaeb
|
@ -361,14 +361,14 @@ static HRESULT WINAPI filter_EnumPins(IMediaStreamFilter *iface, IEnumPins **enu
|
||||||
|
|
||||||
TRACE("iface %p, enum_pins %p.\n", iface, enum_pins);
|
TRACE("iface %p, enum_pins %p.\n", iface, enum_pins);
|
||||||
|
|
||||||
EnterCriticalSection(&filter->cs);
|
|
||||||
|
|
||||||
if (!enum_pins)
|
if (!enum_pins)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if (!(object = heap_alloc(sizeof(*object))))
|
if (!(object = heap_alloc(sizeof(*object))))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
EnterCriticalSection(&filter->cs);
|
||||||
|
|
||||||
object->IEnumPins_iface.lpVtbl = &enum_pins_vtbl;
|
object->IEnumPins_iface.lpVtbl = &enum_pins_vtbl;
|
||||||
object->refcount = 1;
|
object->refcount = 1;
|
||||||
object->count = filter->nb_streams;
|
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))))
|
if (!(object->pins = heap_alloc(filter->nb_streams * sizeof(*object->pins))))
|
||||||
{
|
{
|
||||||
heap_free(object);
|
heap_free(object);
|
||||||
|
LeaveCriticalSection(&filter->cs);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
for (i = 0; i < filter->nb_streams; ++i)
|
for (i = 0; i < filter->nb_streams; ++i)
|
||||||
|
|
Loading…
Reference in New Issue