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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 RTCPPacketInformation& rtcpPacketInformation) { 1092 RTCPPacketInformation& rtcpPacketInformation) {
1093 // in theory there could be multiple slices lost 1093 // in theory there could be multiple slices lost
1094 rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpSli; // received signal that we need to refresh a slice 1094 rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpSli; // received signal that we need to refresh a slice
1095 rtcpPacketInformation.sliPictureId = rtcpPacket.SLIItem.PictureId; 1095 rtcpPacketInformation.sliPictureId = rtcpPacket.SLIItem.PictureId;
1096 } 1096 }
1097 1097
1098 void 1098 void
1099 RTCPReceiver::HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser, 1099 RTCPReceiver::HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
1100 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) 1100 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
1101 { 1101 {
1102 const RTCPUtility::RTCPPacket& rtcpPacket = rtcpParser.Packet(); 1102 const RTCPUtility::RTCPPacket& rtcpPacket = rtcpParser.Packet();
1103 RTCPUtility::RTCPPacketTypes pktType = rtcpParser.Iterate(); 1103 if (rtcpPacket.RPSI.NumberOfValidBits % 8 != 0) {
1104 if (pktType == RTCPPacketTypes::kPsfbRpsi) { 1104 rtcpParser.Iterate();
åsapersson 2016/04/11 09:22:55 kPsfbRpsiItem?
danilchap 2016/04/11 11:00:31 For neighbor packets 'Item' suffix means subpacket
1105 rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpRpsi; // received sign al that we have a confirmed reference picture 1105 return;
1106 if(rtcpPacket.RPSI.NumberOfValidBits%8 != 0) 1106 }
1107 { 1107 // Received signal that we have a confirmed reference picture.
1108 // to us unknown 1108 rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpRpsi;
1109 // continue 1109 rtcpPacketInformation.rpsiPictureId = 0;
1110 rtcpParser.Iterate();
1111 return;
1112 }
1113 rtcpPacketInformation.rpsiPictureId = 0;
1114 1110
1115 // convert NativeBitString to rpsiPictureId 1111 // Convert NativeBitString to rpsiPictureId.
1116 uint8_t numberOfBytes = rtcpPacket.RPSI.NumberOfValidBits /8; 1112 uint8_t numberOfBytes = rtcpPacket.RPSI.NumberOfValidBits / 8;
1117 for(uint8_t n = 0; n < (numberOfBytes-1); n++) 1113 for (uint8_t n = 0; n < numberOfBytes - 1; n++) {
1118 { 1114 rtcpPacketInformation.rpsiPictureId +=
1119 rtcpPacketInformation.rpsiPictureId += (rtcpPacket.RPSI.NativeBitStr ing[n] & 0x7f); 1115 (rtcpPacket.RPSI.NativeBitString[n] & 0x7f);
1120 rtcpPacketInformation.rpsiPictureId <<= 7; // prepare next 1116 rtcpPacketInformation.rpsiPictureId <<= 7; // prepare next
1121 } 1117 }
1122 rtcpPacketInformation.rpsiPictureId += (rtcpPacket.RPSI.NativeBitString[ numberOfBytes-1] & 0x7f); 1118 rtcpPacketInformation.rpsiPictureId +=
1123 } 1119 (rtcpPacket.RPSI.NativeBitString[numberOfBytes - 1] & 0x7f);
1120 rtcpParser.Iterate();
1124 } 1121 }
1125 1122
1126 void RTCPReceiver::HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser, 1123 void RTCPReceiver::HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
1127 RTCPPacketInformation& rtcpPacketInformation) { 1124 RTCPPacketInformation& rtcpPacketInformation) {
1128 RTCPUtility::RTCPPacketTypes pktType = rtcpParser.Iterate(); 1125 RTCPUtility::RTCPPacketTypes pktType = rtcpParser.Iterate();
1129 if (pktType == RTCPPacketTypes::kPsfbRemb) { 1126 if (pktType == RTCPPacketTypes::kPsfbRemb) {
1130 pktType = rtcpParser.Iterate(); 1127 pktType = rtcpParser.Iterate();
1131 if (pktType == RTCPPacketTypes::kPsfbRembItem) { 1128 if (pktType == RTCPPacketTypes::kPsfbRembItem) {
1132 HandleREMBItem(rtcpParser, rtcpPacketInformation); 1129 HandleREMBItem(rtcpParser, rtcpPacketInformation);
1133 rtcpParser.Iterate(); 1130 rtcpParser.Iterate();
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 return -1; 1440 return -1;
1444 } 1441 }
1445 num += receiveInfo->TmmbrSet.lengthOfSet(); 1442 num += receiveInfo->TmmbrSet.lengthOfSet();
1446 receiveInfoIt++; 1443 receiveInfoIt++;
1447 } 1444 }
1448 } 1445 }
1449 return num; 1446 return num;
1450 } 1447 }
1451 1448
1452 } // namespace webrtc 1449 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698