From 4303e191c7d3df9fa4e372f2d17535fb0bfaa15c Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 12 May 2026 11:03:06 +0200 Subject: [PATCH] MT#61856 check PS before cleaning in `__streams_set_sinks()` Usage before hints that given pointer might be NULL, so better to check before actually clean. Change-Id: I8463476ab584474b7459bc52dba82f4919938489 --- daemon/call.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index beca6ab3b..79666ba1a 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1373,12 +1373,17 @@ static bool __streams_set_sinks(struct call_media *A, struct call_media *B, else if (b_rtp && MEDIA_ISSET(B, SEND)) __add_sink_handler(&a_rtp->rtp_sinks, b_rtp, attrs); - PS_CLEAR(b_rtp, ZERO_ADDR); + if (b_rtp) + PS_CLEAR(b_rtp, ZERO_ADDR); + if (is_addr_unspecified(&a_rtp->advertised_endpoint.address) && !(is_trickle_ice_address(&a_rtp->advertised_endpoint) && MEDIA_ISSET(A, TRICKLE_ICE)) && !(flags && flags->replace_zero_address)) - PS_SET(b_rtp, ZERO_ADDR); + { + if (b_rtp) + PS_SET(b_rtp, ZERO_ADDR); + } /* RTCP */ lb = lb->next;