From dc983a246c7085dc2f36e840bb46b44e20d87e96 Mon Sep 17 00:00:00 2001 From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> Date: Fri, 16 Jun 2017 15:18:46 -0400 Subject: [PATCH] fix assertion when no remote SDP available This situation may happens when the INVITE response is valid (200) but there are some SDP decoding errors. Prevent crash by assert, by returning an empty result. Change-Id: Ic1f2914eb6b5f4018d5b90775132ecd564a31334 Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> --- src/sip/sdp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sip/sdp.cpp b/src/sip/sdp.cpp index 12ee18f532..1b9f3ab7e7 100644 --- a/src/sip/sdp.cpp +++ b/src/sip/sdp.cpp @@ -717,9 +717,9 @@ IceTransport::Attribute Sdp::getIceAttributes() const { IceTransport::Attribute ice_attrs; - auto session = activeRemoteSession_ ? activeRemoteSession_ : remoteSession_; - assert(session); - return getIceAttributes(session); + if (auto session = (activeRemoteSession_ ? activeRemoteSession_ : remoteSession_)) + return getIceAttributes(session); + return {}; } IceTransport::Attribute -- GitLab