From cd20d6c5807026965e7f0c845a1d72769d91f201 Mon Sep 17 00:00:00 2001 From: Alessandro Toppi Date: Wed, 11 Nov 2020 18:20:38 +0100 Subject: [PATCH] Add an additional check for participant->room ptr in audiobridge plugin handler (#2432). --- plugins/janus_audiobridge.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/janus_audiobridge.c b/plugins/janus_audiobridge.c index ba85c7bca9..780986ca04 100644 --- a/plugins/janus_audiobridge.c +++ b/plugins/janus_audiobridge.c @@ -6292,6 +6292,14 @@ static void *janus_audiobridge_handler(void *data) { msg = NULL; continue; } + if(participant == NULL || participant->room == NULL) { + JANUS_LOG(LOG_ERR, "Can't handle SDP (not in a room)\n"); + error_code = JANUS_AUDIOBRIDGE_ERROR_NOT_JOINED; + g_snprintf(error_cause, 512, "Can't handle SDP (not in a room)"); + if(sdp) + janus_sdp_destroy(sdp); + goto error; + } /* We use a custom session name in the SDP */ char s_name[100]; g_snprintf(s_name, sizeof(s_name), "AudioBridge %s", participant->room->room_id_str);