qcap: Make sure input to AMStreamConfig_SetFormat is not NULL.

This commit is contained in:
Lei Zhang 2008-09-16 13:54:20 -07:00 committed by Alexandre Julliard
parent 24e426517e
commit 62823d272d
1 changed files with 7 additions and 1 deletions

View File

@ -400,7 +400,7 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
ICOM_THIS_MULTI(VfwCapture, IAMStreamConfig_vtbl, iface);
IPinImpl *pin;
TRACE("(%p): %p->%p\n", iface, pmt, pmt->pbFormat);
TRACE("(%p): %p->%p\n", iface, pmt, pmt ? pmt->pbFormat : NULL);
if (This->state != State_Stopped)
{
@ -408,6 +408,12 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
return VFW_E_NOT_STOPPED;
}
if (!pmt)
{
TRACE("pmt is NULL\n");
return E_POINTER;
}
dump_AM_MEDIA_TYPE(pmt);
pin = (IPinImpl *)This->pOutputPin;