Skip to content
Snippets Groups Projects
Unverified Commit 891f29c3 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

sipcall: check media_tr

avoid segfault. Backtrace from the play store

Change-Id: I5a44a5ee190cba22ed31ef4c7f64703b352db7fe
parent 775dbedb
No related branches found
No related tags found
No related merge requests found
...@@ -1034,9 +1034,13 @@ SIPCall::setupLocalSDPFromIce() ...@@ -1034,9 +1034,13 @@ SIPCall::setupLocalSDPFromIce()
std::vector<IceCandidate> std::vector<IceCandidate>
SIPCall::getAllRemoteCandidates() SIPCall::getAllRemoteCandidates()
{ {
std::vector<IceCandidate> rem_candidates;
auto media_tr = getIceMediaTransport(); auto media_tr = getIceMediaTransport();
if (not media_tr) {
JAMI_WARN("[call:%s] no media ICE transport", getCallId().c_str());
return {};
}
auto addSDPCandidates = [&, this](unsigned sdpMediaId, std::vector<IceCandidate>& out) { auto addSDPCandidates = [&, this](unsigned sdpMediaId, std::vector<IceCandidate>& out) {
IceCandidate cand; IceCandidate cand;
for (auto& line : sdp_->getIceCandidates(sdpMediaId)) { for (auto& line : sdp_->getIceCandidates(sdpMediaId)) {
...@@ -1049,6 +1053,7 @@ SIPCall::getAllRemoteCandidates() ...@@ -1049,6 +1053,7 @@ SIPCall::getAllRemoteCandidates()
} }
}; };
std::vector<IceCandidate> rem_candidates;
addSDPCandidates(SDP_AUDIO_MEDIA_ID, rem_candidates); addSDPCandidates(SDP_AUDIO_MEDIA_ID, rem_candidates);
#ifdef ENABLE_VIDEO #ifdef ENABLE_VIDEO
addSDPCandidates(SDP_VIDEO_MEDIA_ID, rem_candidates); addSDPCandidates(SDP_VIDEO_MEDIA_ID, rem_candidates);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment