Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc

Issue 2549233005: Reject XR TargetBitrate items with unsupported layer indices (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698