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

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

Issue 1870573004: 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 | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.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_receiver.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 1bfa7cdebc3106b09514fb205ed87d13e00b05a2..0169e0a08274fca936f17fbefaa94a3d1981c961 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -1099,28 +1099,25 @@ void
RTCPReceiver::HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
{
- const RTCPUtility::RTCPPacket& rtcpPacket = rtcpParser.Packet();
- RTCPUtility::RTCPPacketTypes pktType = rtcpParser.Iterate();
- if (pktType == RTCPPacketTypes::kPsfbRpsi) {
- rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpRpsi; // received signal that we have a confirmed reference picture
- if(rtcpPacket.RPSI.NumberOfValidBits%8 != 0)
- {
- // to us unknown
- // continue
- rtcpParser.Iterate();
- return;
- }
- rtcpPacketInformation.rpsiPictureId = 0;
+ const RTCPUtility::RTCPPacket& rtcpPacket = rtcpParser.Packet();
+ if (rtcpPacket.RPSI.NumberOfValidBits % 8 != 0) {
+ rtcpParser.Iterate();
+ return;
+ }
+ // Received signal that we have a confirmed reference picture.
+ rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpRpsi;
+ rtcpPacketInformation.rpsiPictureId = 0;
- // convert NativeBitString to rpsiPictureId
- uint8_t numberOfBytes = rtcpPacket.RPSI.NumberOfValidBits /8;
- for(uint8_t n = 0; n < (numberOfBytes-1); n++)
- {
- rtcpPacketInformation.rpsiPictureId += (rtcpPacket.RPSI.NativeBitString[n] & 0x7f);
- rtcpPacketInformation.rpsiPictureId <<= 7; // prepare next
- }
- rtcpPacketInformation.rpsiPictureId += (rtcpPacket.RPSI.NativeBitString[numberOfBytes-1] & 0x7f);
- }
+ // Convert NativeBitString to rpsiPictureId.
+ uint8_t numberOfBytes = rtcpPacket.RPSI.NumberOfValidBits / 8;
+ for (uint8_t n = 0; n < numberOfBytes - 1; n++) {
+ rtcpPacketInformation.rpsiPictureId +=
+ (rtcpPacket.RPSI.NativeBitString[n] & 0x7f);
+ rtcpPacketInformation.rpsiPictureId <<= 7; // prepare next
+ }
+ rtcpPacketInformation.rpsiPictureId +=
+ (rtcpPacket.RPSI.NativeBitString[numberOfBytes - 1] & 0x7f);
+ rtcpParser.Iterate();
}
void RTCPReceiver::HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698