From d28629f51191821b2c26935735b66842de039ec2 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 16 Sep 2008 13:54:20 -0700 Subject: [PATCH] qcap: Make sure input to AMStreamConfig_SetFormat is not NULL. --- dlls/qcap/vfwcapture.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index fa4754f..738e1d2 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -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; -- 1.5.4.5