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

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: removed unrelated comment 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
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) {
åsapersson 2016/04/11 09:22:55 kPsfbRpsiItem?
danilchap 2016/04/11 11:00:31 For neighbor packets 'Item' suffix means subpacket
- 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,

Powered by Google App Engine
This is Rietveld 408576698