From 2e960e70750a0cb7e1117d0c09d08597866a29ee Mon Sep 17 00:00:00 2001 From: Miguel París Díaz Date: Thu, 5 May 2016 14:18:21 +0200 Subject: rtpsession: Take session lock when creating stats The access to the session hash table must happen while the session lock is taken, otherwise another thread might modify the hash table while we're creating the stats. https://bugzilla.gnome.org/show_bug.cgi?id=766025 --- gst/rtpmanager/rtpsession.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index 3c26e3467..e530c95b8 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -749,10 +749,12 @@ rtp_session_create_stats (RTPSession * sess) "sent-nack-count", G_TYPE_UINT, sess->stats.nacks_sent, "recv-nack-count", G_TYPE_UINT, sess->stats.nacks_received, NULL); + RTP_SESSION_LOCK (sess); size = g_hash_table_size (sess->ssrcs[sess->mask_idx]); source_stats = g_value_array_new (size); g_hash_table_foreach (sess->ssrcs[sess->mask_idx], (GHFunc) create_source_stats, source_stats); + RTP_SESSION_UNLOCK (sess); g_value_init (&source_stats_v, G_TYPE_VALUE_ARRAY); g_value_take_boxed (&source_stats_v, source_stats); -- cgit v1.2.3