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

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


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

dshow: Check for NULLity before dereferencing

CID #1402712

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

 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