Bug 1247656: Make sure that remote reoffer does not change the media type of an m-line. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 11 Feb 2016 13:00:58 -0600
changeset 323873 b0da28952e5ba757afd5c7098d633e09ce929b60
parent 323872 525acdb20f3ae457cd7d05e2a4c4fafa63dab73d
child 323874 0e868ee89abc73e4142af02b51c80681c0960293
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1247656
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1247656: Make sure that remote reoffer does not change the media type of an m-line. r=drno MozReview-Commit-ID: DFXgLuSW6nM
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
--- 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 "