From ad14bac870b421457a3fbe7b0a716b72a1b27006 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 18 Aug 2008 13:08:25 +0200 Subject: [PATCH] Fixed a potential race condition in interaction. --- src/interface/interaction.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/interface/interaction.c b/src/interface/interaction.c index f58d757eb7..eaca6d815b 100644 --- a/src/interface/interaction.c +++ b/src/interface/interaction.c @@ -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 ) { -- 2.39.2