Module: wine Branch: master Commit: d6f8d8f25b96dbb97c769debd1268754de38cd35 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6f8d8f25b96dbb97c769debd1...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Nov 26 14:34:32 2013 +0100
strmbase: Don't pass NULL fetched parameter in BaseOutputPinImpl_Connect on external IPin implementation.
---
dlls/strmbase/pin.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index eb9b23c..e4ddd38 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -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);