]> git.sesse.net Git - vlc/commitdiff
Fixed a potential race condition in interaction.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 18 Aug 2008 11:08:25 +0000 (13:08 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 18 Aug 2008 17:37:50 +0000 (19:37 +0200)
src/interface/interaction.c

index f58d757eb798b9e8762b7d46847ef298fe7887ab..eaca6d815b9d665f7b8f651399e3be476b8b2528 100644 (file)
@@ -470,9 +470,14 @@ static int DialogSend( vlc_object_t *p_this, interaction_dialog_t *p_dialog )
 {
     interaction_t *p_interaction = InteractionGet( p_this );
 
+    if( !p_interaction )
+        return VLC_EGENERIC;
+
     /* Get an id, if we don't already have one */
+    vlc_object_lock( p_interaction );
     if( p_dialog->i_id == 0 )
         p_dialog->i_id = ++p_interaction->i_last_id;
+    vlc_object_unlock( p_interaction );
 
     if( p_this->i_flags & OBJECT_FLAGS_NOINTERACT )
     {