提交 631796b0 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Remove a potential crash if a single `encoding` is given in the Producer…

Remove a potential crash if a single `encoding` is given in the Producer `rtpParameters` and it has a `profile` value.
上级 18d0e54a
...@@ -310,5 +310,11 @@ namespace RTC ...@@ -310,5 +310,11 @@ namespace RTC
if (!pair.second) if (!pair.second)
MS_THROW_ERROR("duplicated encoding.profile"); MS_THROW_ERROR("duplicated encoding.profile");
} }
// If there is a single encoding, it MUST NOT have any profile.
if (this->encodings.size() == 1 && this->encodings[0].profile != RTC::RtpEncodingParameters::Profile::DEFAULT)
{
MS_THROW_ERROR("invalid single encoding with non default profile");
}
} }
} // namespace RTC } // namespace RTC
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论