Commit 7deab426 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Fix potential race in IPinImpl_ConnectedTo.

parent c626491b
......@@ -247,19 +247,25 @@ HRESULT WINAPI IPinImpl_Disconnect(IPin * iface)
HRESULT WINAPI IPinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
{
HRESULT hr;
ICOM_THIS(IPinImpl, iface);
/* TRACE("(%p)\n", ppPin);*/
*ppPin = This->pConnectedTo;
if (*ppPin)
EnterCriticalSection(This->pCritSec);
{
IPin_AddRef(*ppPin);
return S_OK;
if (This->pConnectedTo)
{
*ppPin = This->pConnectedTo;
IPin_AddRef(*ppPin);
hr = S_OK;
}
else
hr = VFW_E_NOT_CONNECTED;
}
else
return VFW_E_NOT_CONNECTED;
LeaveCriticalSection(This->pCritSec);
return hr;
}
HRESULT WINAPI IPinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt)
......
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