From 555f617b206ca492731fa355ba9e8db1d00f87dc Mon Sep 17 00:00:00 2001 From: Tom Briden Date: Tue, 18 Jul 2023 10:56:38 +0100 Subject: [PATCH] MT#55283 Fix not sending metadata on TLS forwarded ... stream after a reconnect if we're in the middle of a disconnect then ssrc_tls_state may have destroyed the streambuf so we need to skip the rest of the function, otherwise the now null pointer is passed into streambuf_write, which will return immediately and the metadata will have been marked as sent when it hasn't been closes #1694 Change-Id: I679fdd0ff9245e4413bc5a5ab40a70ea4f9ef7c0 (cherry picked from commit 88c0ffd49b202e3e257201a9ead063544b507f97) --- recording-daemon/decoder.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recording-daemon/decoder.c b/recording-daemon/decoder.c index 55c3ee572..227bece95 100644 --- a/recording-daemon/decoder.c +++ b/recording-daemon/decoder.c @@ -146,9 +146,15 @@ no_recording: if (ssrc->tls_fwd_stream) { // XXX might be a second resampling to same format dbg("SSRC %lx of stream #%lu has TLS forwarding stream", ssrc->ssrc, stream->id); - AVFrame *dec_frame = resample_frame(&ssrc->tls_fwd_resampler, frame, &ssrc->tls_fwd_format); ssrc_tls_state(ssrc); + // if we're in the middle of a disconnect then ssrc_tls_state may have destroyed the streambuf + // so we need to skip the below to ensure we only send metadata for the new connection + // once we've got a new streambuf + if (!ssrc->tls_fwd_stream) + goto err; + + AVFrame *dec_frame = resample_frame(&ssrc->tls_fwd_resampler, frame, &ssrc->tls_fwd_format); if (!ssrc->sent_intro) { tag_t *tag = NULL;