From 31af6cb46b0823d6169d622272f07e9d59a28926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 16 Jul 2025 18:02:21 +0300 Subject: [PATCH] rtprecv: Drop state lock before chaining RTCP packets from the RTP chain function Otherwise the state lock is taken twice and will cause a deadlock. Part-of: --- net/rtp/src/rtpbin2/rtprecv.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/rtp/src/rtpbin2/rtprecv.rs b/net/rtp/src/rtpbin2/rtprecv.rs index d9dc2b0c0..7ff7dd2fa 100644 --- a/net/rtp/src/rtpbin2/rtprecv.rs +++ b/net/rtp/src/rtpbin2/rtprecv.rs @@ -1501,7 +1501,10 @@ impl RtpRecv { RecvRtpBuffer::SsrcCollision(ssrc) => { return self.handle_ssrc_collision(session, [ssrc]) } - RecvRtpBuffer::IsRtcp(buffer) => return Self::rtcp_sink_chain(self, id, buffer), + RecvRtpBuffer::IsRtcp(buffer) => { + drop(state); + return Self::rtcp_sink_chain(self, id, buffer); + } RecvRtpBuffer::Drop => None, RecvRtpBuffer::Forward((buffer, jb)) => Some((buffer, jb)), };