[vlc-commits] qt: fix race on input_item_t.p_stats
Rémi Denis-Courmont
git at videolan.org
Mon Dec 11 21:02:26 CET 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 11 21:09:25 2017 +0200| [996f66c65c7840e298efe38adac39e9315e262d1] | 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=996f66c65c7840e298efe38adac39e9315e262d1
---
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