From 7b59f55457c8d12852232132e71377913af63111 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 6 Jul 2021 09:37:15 -0400 Subject: [PATCH] TT#14008 fix handling of possible NULL rtcp_sibling closes #1302 Change-Id: I000337734400cf3a5b63fc5d51e9fd220be06c68 --- daemon/call.c | 7 +++++-- daemon/media_socket.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 29410a60e..3f6950f9c 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1268,7 +1268,7 @@ static int __init_streams(struct call_media *A, struct call_media *B, const stru PS_CLEAR(a, RTCP); else { if (MEDIA_ISSET(A, ECHO) || MEDIA_ISSET(A, BLACKHOLE)) - __add_sink_handler(&a->rtcp_sinks, a->rtcp_sibling); + { /* RTCP sink handler added below */ } else __add_sink_handler(&a->rtcp_sinks, b); PS_SET(a, RTCP); @@ -1283,8 +1283,11 @@ static int __init_streams(struct call_media *A, struct call_media *B, const stru assert(la != NULL); a = la->data; - if (MEDIA_ISSET(A, ECHO) || MEDIA_ISSET(A, BLACKHOLE)) + if (MEDIA_ISSET(A, ECHO) || MEDIA_ISSET(A, BLACKHOLE)) { __add_sink_handler(&a->rtcp_sinks, a); + if (MEDIA_ISSET(A, RTCP_MUX)) + __add_sink_handler(&ax->rtcp_sinks, a); + } else __add_sink_handler(&a->rtcp_sinks, b); PS_CLEAR(a, RTP); diff --git a/daemon/media_socket.c b/daemon/media_socket.c index ff8600920..09c67081f 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1694,7 +1694,8 @@ static void media_packet_rtcp_demux(struct packet_handler_ctx *phc) int muxed_rtcp = rtcp_demux(&phc->s, phc->mp.media); if (muxed_rtcp == 2) { is_rtcp = 1; - phc->in_srtp = phc->mp.stream->rtcp_sibling; // use RTCP SRTP context + if (phc->mp.stream->rtcp_sibling) + phc->in_srtp = phc->mp.stream->rtcp_sibling; // use RTCP SRTP context } } if (is_rtcp) {