[vlc-commits] dereference p_libvlc->p_vlm after the media clean up

Sébastien Escudier git at videolan.org
Mon Feb 27 13:21:07 CET 2012


vlc/vlc-2.0 | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Tue Feb 21 12:56:56 2012 +0100| [3690b371288b5fb0c3f1a66a32753778b7a8beb6] | committer: Sébastien Escudier

dereference p_libvlc->p_vlm after the media clean up
(cherry picked from commit 88e497880b252bc2a73b8e14cd9b6c5ddc13bc77)

Signed-off-by: Sébastien Escudier <sebastien-devel at celeos.eu>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=3690b371288b5fb0c3f1a66a32753778b7a8beb6
---

 src/input/vlm.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 1e7aff7..4dce5ec 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -214,16 +214,15 @@ void vlm_Delete( vlm_t *p_vlm )
     vlc_mutex_lock( &vlm_mutex );
     assert( p_vlm->users > 0 );
     if( --p_vlm->users == 0 )
-    {
         assert( libvlc_priv(p_vlm->p_libvlc)->p_vlm == p_vlm );
-        libvlc_priv(p_vlm->p_libvlc)->p_vlm = NULL;
-    }
     else
         p_vlm = NULL;
-    vlc_mutex_unlock( &vlm_mutex );
 
     if( p_vlm == NULL )
+    {
+        vlc_mutex_unlock( &vlm_mutex );
         return;
+    }
 
     /* Destroy and release VLM */
     vlc_mutex_lock( &p_vlm->lock );
@@ -242,6 +241,9 @@ void vlm_Delete( vlm_t *p_vlm )
         vlc_object_release( p_vlm->p_vod );
     }
 
+    libvlc_priv(p_vlm->p_libvlc)->p_vlm = NULL;
+    vlc_mutex_unlock( &vlm_mutex );
+
     vlc_mutex_lock( &p_vlm->lock_manage );
     p_vlm->input_state_changed = true;
     vlc_cond_signal( &p_vlm->wait_manage );



More information about the vlc-commits mailing list