Bug 1370562: Don't try to validate attributes on disabled m-sections in answers. r?drno
MozReview-Commit-ID: 1T7busmzZPZ
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -1790,16 +1790,26 @@ JsepSessionImpl::ValidateAnswer(const Sd
const SdpMediaSection& answerMsection = answer.GetMediaSection(i);
if (offerMsection.GetMediaType() != answerMsection.GetMediaType()) {
JSEP_SET_ERROR(
"Answer and offer have different media types at m-line " << i);
return NS_ERROR_INVALID_ARG;
}
+ if (mSdpHelper.MsectionIsDisabled(answerMsection)) {
+ continue;
+ }
+
+ if (mSdpHelper.MsectionIsDisabled(offerMsection)) {
+ JSEP_SET_ERROR("Answer tried to enable an m-section that was disabled in "
+ "the offer");
+ return NS_ERROR_INVALID_ARG;
+ }
+
if (!offerMsection.IsSending() && answerMsection.IsReceiving()) {
JSEP_SET_ERROR("Answer tried to set recv when offer did not set send");
return NS_ERROR_INVALID_ARG;
}
if (!offerMsection.IsReceiving() && answerMsection.IsSending()) {
JSEP_SET_ERROR("Answer tried to set send when offer did not set recv");
return NS_ERROR_INVALID_ARG;