Chris Robinson : quartz: Properly handle input parameters in FileSource_GetCurFile.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 14 09:25:39 CST 2007


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

Author: Chris Robinson <chris.kcat at gmail.com>
Date:   Tue Feb 13 14:28:02 2007 -0800

quartz: Properly handle input parameters in FileSource_GetCurFile.

---

 dlls/quartz/filesource.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 786252f..691413d 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -637,6 +637,9 @@ static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter * iface, LPOLESTR
     
     TRACE("(%p, %p)\n", ppszFileName, pmt);
 
+    if (!ppszFileName)
+        return E_POINTER;
+
     /* copy file name & media type if available, otherwise clear the outputs */
     if (This->pszFileName)
     {
@@ -646,12 +649,13 @@ static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter * iface, LPOLESTR
     else
         *ppszFileName = NULL;
 
-    if (This->pmt)
+    if (pmt)
     {
-        CopyMediaType(pmt, This->pmt);
+        if (This->pmt)
+            CopyMediaType(pmt, This->pmt);
+        else
+            ZeroMemory(pmt, sizeof(*pmt));
     }
-    else
-        ZeroMemory(pmt, sizeof(*pmt));
 
     return S_OK;
 }




More information about the wine-cvs mailing list