Bug 1247656: Make sure that remote reoffer does not change the media type of an m-line. r=drno
MozReview-Commit-ID: DFXgLuSW6nM
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -1844,16 +1844,23 @@ JsepSessionImpl::ValidateRemoteDescripti
for (size_t i = 0;
i < mCurrentRemoteDescription->GetMediaSectionCount();
++i) {
if (mSdpHelper.MsectionIsDisabled(description.GetMediaSection(i)) ||
mSdpHelper.MsectionIsDisabled(mCurrentRemoteDescription->GetMediaSection(i))) {
continue;
}
+ if (mCurrentRemoteDescription->GetMediaSection(i).GetMediaType() !=
+ description.GetMediaSection(i).GetMediaType()) {
+ JSEP_SET_ERROR("Remote description changes the media type of m-line "
+ << i);
+ return NS_ERROR_INVALID_ARG;
+ }
+
const SdpAttributeList& newAttrs(
description.GetMediaSection(i).GetAttributeList());
const SdpAttributeList& oldAttrs(
mCurrentRemoteDescription->GetMediaSection(i).GetAttributeList());
if ((newAttrs.GetIceUfrag() != oldAttrs.GetIceUfrag()) ||
(newAttrs.GetIcePwd() != oldAttrs.GetIcePwd())) {
JSEP_SET_ERROR("ICE restart is unsupported at this time "