Lei Zhang : qcap: Make sure input to AMStreamConfig_SetFormat is not NULL.

Alexandre Julliard julliard at winehq.org
Wed Sep 17 07:15:13 CDT 2008


Module: wine
Branch: master
Commit: 62823d272dd988f9417fa1bc4207c8cc9467d7d0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62823d272dd988f9417fa1bc4207c8cc9467d7d0

Author: Lei Zhang <thestig at google.com>
Date:   Tue Sep 16 13:54:20 2008 -0700

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;




More information about the wine-cvs mailing list