Skip to content
Snippets Groups Projects
Commit 761d38e6 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Edric Milaret
Browse files

rtp: fix RtpSession::restartSender()

Calling this API causes a race condition with RtpSession::start().
The former needs the latter to be run first, this was not enforced,
causing a crash by nullptr access on socketPair_ member.
This patch checks for a non-nullptr socketPair_ to procceed the restart.

Issue: #81987
Change-Id: I20886fe70398f018621aade1c7bac3ff15ef9055
parent fe932995
No related branches found
No related tags found
No related merge requests found
......@@ -392,6 +392,10 @@ void
AudioRtpSession::restartSender()
{
std::lock_guard<std::recursive_mutex> lock(mutex_);
// ensure that start has been called before restart
if (not socketPair_)
return;
startSender();
}
......
......@@ -114,6 +114,10 @@ VideoRtpSession::restartSender()
{
std::lock_guard<std::recursive_mutex> lock(mutex_);
// ensure that start has been called before restart
if (not socketPair_)
return;
startSender();
setupVideoPipeline();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment