Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| index 3a4afef42558f83e07c2a62a02a0b4150bef6ffc..e3f6474d3657ec8993975e4a60d165d8f81e7744 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| @@ -231,9 +231,8 @@ constexpr const char* VideoContentTypeExtension::kUri; |
| bool VideoContentTypeExtension::Parse(rtc::ArrayView<const uint8_t> data, |
| VideoContentType* content_type) { |
| - if (data.size() == 1 && |
| - data[0] < static_cast<uint8_t>(VideoContentType::TOTAL_CONTENT_TYPES)) { |
| - *content_type = static_cast<VideoContentType>(data[0]); |
| + if (data.size() == 1 && VideoContentType::IsValidContentType(data[0])) { |
|
sprang_webrtc
2017/07/26 14:13:43
Maybe be lenient when parsing? Mask out the lowest
ilnik
2017/07/26 14:49:48
I think this static one-liner function will be opt
|
| + *content_type = data[0]; |
| return true; |
| } |
| return false; |