From 729e4648821c809e2dbee363aa7ecc12df4aeb4e Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Mon, 8 Jan 2024 13:18:52 +0100 Subject: [PATCH] rtp: lock rtcp_set_srate() (#1043) --- src/rtp/sess.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rtp/sess.c b/src/rtp/sess.c index 4d03ae0a8..78a0bb54a 100644 --- a/src/rtp/sess.c +++ b/src/rtp/sess.c @@ -306,8 +306,10 @@ void rtcp_set_srate(struct rtp_sock *rs, uint32_t srate_tx, uint32_t srate_rx) if (!sess) return; + mtx_lock(sess->lock); sess->srate_tx = srate_tx; sess->srate_rx = srate_rx; + mtx_unlock(sess->lock); } @@ -339,7 +341,9 @@ void rtcp_set_srate_rx(struct rtp_sock *rs, uint32_t srate_rx) if (!sess) return; + mtx_lock(sess->lock); sess->srate_rx = srate_rx; + mtx_unlock(sess->lock); }