Commit d6f8d8f2 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

strmbase: Don't pass NULL fetched parameter in BaseOutputPinImpl_Connect on…

strmbase: Don't pass NULL fetched parameter in BaseOutputPinImpl_Connect on external IPin implementation.
parent 995ff1d3
......@@ -419,6 +419,9 @@ HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pReceivePin, pmt);
dump_AM_MEDIA_TYPE(pmt);
if (!pReceivePin)
return E_POINTER;
/* If we try to connect to ourselves, we will definitely deadlock.
* There are other cases where we could deadlock too, but this
* catches the obvious case */
......@@ -465,9 +468,11 @@ HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const
/* then try receiver filter's media types */
if (hr != S_OK && SUCCEEDED(hr = IPin_EnumMediaTypes(pReceivePin, &pEnumCandidates))) /* if we haven't already connected successfully */
{
ULONG fetched;
hr = VFW_E_NO_ACCEPTABLE_TYPES; /* Assume the worst, but set to S_OK if connected successfully */
while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, NULL))
while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, &fetched))
{
assert(pmtCandidate);
dump_AM_MEDIA_TYPE(pmtCandidate);
......
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