sipcall: do not use invalid pointer on videoRtp

Change-Id: Iccd5fa02855fb8dc33529177e2fb14d7588add44
This commit is contained in:
Sébastien Blin
2022-03-19 18:46:10 -04:00
parent 0c57cee538
commit 0c98f2b1ff

View File

@ -2147,18 +2147,18 @@ SIPCall::stopAllMedia()
audioRtp->stop();
#ifdef ENABLE_VIDEO
auto const& videoRtp = getVideoRtp();
{
std::lock_guard<std::mutex> lk(sinksMtx_);
auto& videoReceive = videoRtp->getVideoReceive();
if (videoReceive) {
auto& sink = videoReceive->getSink();
for (auto it = callSinksMap_.begin(); it != callSinksMap_.end();) {
sink->detach(it->second.get());
it->second->stop();
it = callSinksMap_.erase(it);
for (auto it = callSinksMap_.begin(); it != callSinksMap_.end();) {
if (videoRtp) {
auto& videoReceive = videoRtp->getVideoReceive();
if (videoReceive) {
auto& sink = videoReceive->getSink();
sink->detach(it->second.get());
}
}
it->second->stop();
it = callSinksMap_.erase(it);
}
}