[vlc-commits] Qt: epg: missing lock before es_out data access

Francois Cartegnie git at videolan.org
Tue Mar 15 21:36:47 CET 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar 10 19:38:04 2011 +0100| [f37779bca6c6e7932c458ed4b9f2cd6ee6950ddb] | committer: Francois Cartegnie

Qt: epg: missing lock before es_out data access

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

 modules/gui/qt4/dialogs/epg.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 9d4b95e..4d23d28 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -129,10 +129,13 @@ void EpgDialog::updateInfos()
 {
     if( !THEMIM->getInput() ) return;
     timer->stop();
-    int i_nbitems = input_GetItem( THEMIM->getInput())->i_epg;
+    input_item_t *p_input_item = input_GetItem( THEMIM->getInput() );
+    vlc_mutex_lock(  & p_input_item->lock );
+    int i_nbitems = p_input_item->i_epg;
     if ( i_nbitems > 0 ) msg_Dbg( p_intf, "Found %i EPG items", i_nbitems );
-    epg->updateEPG( input_GetItem( THEMIM->getInput())->pp_epg,
-                    input_GetItem( THEMIM->getInput())->i_epg,
-                    input_GetItem( THEMIM->getInput())->i_type);
+    epg->updateEPG( p_input_item->pp_epg,
+                    p_input_item->i_epg,
+                    p_input_item->i_type);
+    vlc_mutex_unlock( & p_input_item->lock );
     if ( isVisible() ) timer->start();
 }



More information about the vlc-commits mailing list