[vlc-commits] qt: fix race on input_item_t.p_stats

Rémi Denis-Courmont git at videolan.org
Mon Dec 11 21:07:02 CET 2017


vlc/vlc-3.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 11 21:09:25 2017 +0200| [08594b011da6a1b769f38dd1312f2233852cd297] | committer: Rémi Denis-Courmont

qt: fix race on input_item_t.p_stats

p_stats is written with the input item lock (by the input thread).
Thus the input item lock is necessary to read and dereference p_stats.

(cherry picked from commit 996f66c65c7840e298efe38adac39e9315e262d1)

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

 modules/gui/qt/components/info_panels.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/qt/components/info_panels.cpp b/modules/gui/qt/components/info_panels.cpp
index 265fbbdd6f..5376be235c 100644
--- a/modules/gui/qt/components/info_panels.cpp
+++ b/modules/gui/qt/components/info_panels.cpp
@@ -646,6 +646,11 @@ void InputStatsPanel::update( input_item_t *p_item )
 {
     if ( !isVisible() ) return;
     assert( p_item );
+
+    vlc_mutex_locker(&p_item->lock);
+    if( p_item->p_stats == NULL )
+        return;
+
     vlc_mutex_lock( &p_item->p_stats->lock );
 
 #define UPDATE_INT( widget, calc... ) \



More information about the vlc-commits mailing list