[vlc-devel] commit: release_input_thread: NULL check after dereference ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Feb 17 22:09:44 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 17 23:09:19 2010 +0200| [1994eafa59427665edd4488445304597986bc14f] | committer: Rémi Denis-Courmont 

release_input_thread: NULL check after dereference

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

 src/control/media_player.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/control/media_player.c b/src/control/media_player.c
index f28b369..54c5282 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -102,13 +102,12 @@ static inline void unlock(libvlc_media_player_t *mp)
  */
 static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abort )
 {
-    input_thread_t * p_input_thread;
+    assert( p_mi );
 
-    if( !p_mi || !p_mi->p_input_thread )
+    input_thread_t *p_input_thread = p_mi->p_input_thread;
+    if( !p_input_thread )
         return;
 
-    p_input_thread = p_mi->p_input_thread;
-
     var_DelCallback( p_input_thread, "can-seek",
                      input_seekable_changed, p_mi );
     var_DelCallback( p_input_thread, "can-pause",




More information about the vlc-devel mailing list