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

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

Issue 1880443002: Fixed rtcp rpsi parsing of invalid packets. (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 | « webrtc/modules/rtp_rtcp/source/rtcp_utility.h ('k') | webrtc/test/rtcp_packet_parser.cc » ('j') | 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 63693fa9c2289cfaf7bf229ec82ff8352225e87d..9b5a83515f4c54ddcd0e78d0ebff3ab7f9ca576f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_utility.cc
@@ -1334,11 +1334,19 @@ bool RTCPUtility::RTCPParserV2::ParseRPSIItem() {
return false;
}
- _packetType = RTCPPacketTypes::kPsfbRpsi;
uint8_t padding_bits = *_ptrRTCPData++;
_packet.RPSI.PayloadType = *_ptrRTCPData++;
+ if (padding_bits > static_cast<uint16_t>(length - 2) * 8) {
+ _state = ParseState::State_TopLevel;
+
+ EndCurrentBlock();
+ return false;
+ }
+
+ _packetType = RTCPPacketTypes::kPsfbRpsiItem;
+
memcpy(_packet.RPSI.NativeBitString, _ptrRTCPData, length - 2);
_ptrRTCPData += length - 2;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_utility.h ('k') | webrtc/test/rtcp_packet_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698