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

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

Issue 1888793003: Fixed undefined shift in parsing Tmmbr, Tmmbn and Remb (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
index 9b5a83515f4c54ddcd0e78d0ebff3ab7f9ca576f..424a9df7d4dfd54fc63c07f700949abeb37ee1bf 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
@@ -1447,6 +1447,11 @@ RTCPUtility::RTCPParserV2::ParsePsfbREMBItem()
brMantissa += (_ptrRTCPData[2]);
_ptrRTCPData += 3; // Fwd read data
+ if (brExp >= 32) {
+ _state = ParseState::State_TopLevel;
+ EndCurrentBlock();
+ return false;
+ }
_packet.REMBItem.BitRate = (brMantissa << brExp);
åsapersson 2016/04/18 09:51:47 Might give an incorrect bitrate if brExp > 14, rig
danilchap 2016/04/18 10:41:42 Yes, it can. Updated code to be stricter about uns
const ptrdiff_t length_ssrcs = _ptrRTCPBlockEnd - _ptrRTCPData;
@@ -1503,6 +1508,12 @@ RTCPUtility::RTCPParserV2::ParseTMMBRItem()
_ptrRTCPData += 4; // Fwd read data
+ if (mxtbrExp >= 32) {
+ _state = ParseState::State_TopLevel;
+ EndCurrentBlock();
+ return false;
+ }
+
_packet.TMMBRItem.MaxTotalMediaBitRate = ((mxtbrMantissa << mxtbrExp) / 1000);
_packet.TMMBRItem.MeasuredOverhead = measuredOH;
@@ -1542,6 +1553,12 @@ RTCPUtility::RTCPParserV2::ParseTMMBNItem()
_ptrRTCPData += 4; // Fwd read data
+ if (mxtbrExp >= 32) {
+ _state = ParseState::State_TopLevel;
+ EndCurrentBlock();
+ return false;
+ }
+
_packet.TMMBNItem.MaxTotalMediaBitRate = ((mxtbrMantissa << mxtbrExp) / 1000);
_packet.TMMBNItem.MeasuredOverhead = measuredOH;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698