diff --git a/reactos/dll/directx/qedit/samplegrabber.c b/reactos/dll/directx/qedit/samplegrabber.c index b4912eb63de..d09d5546b19 100644 --- a/reactos/dll/directx/qedit/samplegrabber.c +++ b/reactos/dll/directx/qedit/samplegrabber.c @@ -1014,6 +1014,10 @@ SampleGrabber_Out_IPin_Connect(IPin *iface, IPin *receiver, const AM_MEDIA_TYPE } else type = &This->sg->mtype; + if (!IsEqualGUID(&type->formattype, &FORMAT_None) && + !IsEqualGUID(&type->formattype, &GUID_NULL) && + !type->pbFormat) + return VFW_E_TYPE_NOT_ACCEPTED; hr = IPin_ReceiveConnection(receiver,(IPin*)&This->lpVtbl,type); if (FAILED(hr)) return hr; @@ -1054,6 +1058,10 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M !IsEqualGUID(&This->sg->mtype.formattype,&FORMAT_None) && !IsEqualGUID(&This->sg->mtype.formattype,&type->formattype)) return VFW_E_TYPE_NOT_ACCEPTED; + if (!IsEqualGUID(&type->formattype, &FORMAT_None) && + !IsEqualGUID(&type->formattype, &GUID_NULL) && + !type->pbFormat) + return VFW_E_TYPE_NOT_ACCEPTED; if (This->sg->mtype.pbFormat) CoTaskMemFree(This->sg->mtype.pbFormat); This->sg->mtype = *type;