[vlc-commits] dshow: Check for NULLity before dereferencing

Hugo Beauzée-Luyssen git at videolan.org
Tue Feb 14 15:38:00 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Feb 14 15:26:48 2017 +0100| [7b4b4494c02194ab71c0b125b264c74259d0755f] | committer: Jean-Baptiste Kempf

dshow: Check for NULLity before dereferencing

CID #1402712

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b4b4494c02194ab71c0b125b264c74259d0755f
---

 modules/access/dshow/filter.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index 8205afc..34b0536 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -72,10 +72,10 @@ void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt )
 HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
                               const AM_MEDIA_TYPE *pmtSource )
 {
-    *pmtTarget = *pmtSource;
-
     if( !pmtSource || !pmtTarget ) return S_FALSE;
 
+    *pmtTarget = *pmtSource;
+
     if( pmtSource->cbFormat && pmtSource->pbFormat )
     {
         pmtTarget->pbFormat = (PBYTE)CoTaskMemAlloc( pmtSource->cbFormat );



More information about the vlc-commits mailing list