Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc |
| diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc |
| index c94a9cc362d0ca478dbba3fa3d398b5615e995dc..8370d7f22d7d4fb5ebc4a33fe6e506a178fa4f9d 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc |
| @@ -737,8 +737,16 @@ void RTCPReceiver::HandleXrTargetBitrate( |
| PacketInformation* packet_information) { |
| BitrateAllocation bitrate_allocation; |
| for (const auto& item : target_bitrate.GetTargetBitrates()) { |
| - bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer, |
| - item.target_bitrate_kbps * 1000); |
| + if (item.spatial_layer >= kMaxSpatialLayers || |
|
danilchap
2016/12/06 13:12:56
may be #include "webrtc/common_types.h" directly f
sprang_webrtc
2016/12/06 13:22:41
Done.
|
| + item.temporal_layer >= kMaxTemporalStreams) { |
| + LOG(LS_WARNING) |
| + << "Invalid layer in XR target bitrate pack: spatial index " |
| + << item.spatial_layer << ", temporal index " << item.temporal_layer |
| + << ", dropping."; |
| + } else { |
| + bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer, |
| + item.target_bitrate_kbps * 1000); |
| + } |
| } |
| packet_information->target_bitrate_allocation.emplace(bitrate_allocation); |
| } |