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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 EndCurrentBlock(); 1327 EndCurrentBlock();
1328 return false; 1328 return false;
1329 } 1329 }
1330 if (length > 2 + RTCP_RPSI_DATA_SIZE) { 1330 if (length > 2 + RTCP_RPSI_DATA_SIZE) {
1331 _state = ParseState::State_TopLevel; 1331 _state = ParseState::State_TopLevel;
1332 1332
1333 EndCurrentBlock(); 1333 EndCurrentBlock();
1334 return false; 1334 return false;
1335 } 1335 }
1336 1336
1337 _packetType = RTCPPacketTypes::kPsfbRpsi;
1338 1337
1339 uint8_t padding_bits = *_ptrRTCPData++; 1338 uint8_t padding_bits = *_ptrRTCPData++;
1340 _packet.RPSI.PayloadType = *_ptrRTCPData++; 1339 _packet.RPSI.PayloadType = *_ptrRTCPData++;
1341 1340
1341 if (padding_bits > static_cast<uint16_t>(length - 2) * 8) {
1342 _state = ParseState::State_TopLevel;
1343
1344 EndCurrentBlock();
1345 return false;
1346 }
1347
1348 _packetType = RTCPPacketTypes::kPsfbRpsiItem;
1349
1342 memcpy(_packet.RPSI.NativeBitString, _ptrRTCPData, length - 2); 1350 memcpy(_packet.RPSI.NativeBitString, _ptrRTCPData, length - 2);
1343 _ptrRTCPData += length - 2; 1351 _ptrRTCPData += length - 2;
1344 1352
1345 _packet.RPSI.NumberOfValidBits = 1353 _packet.RPSI.NumberOfValidBits =
1346 static_cast<uint16_t>(length - 2) * 8 - padding_bits; 1354 static_cast<uint16_t>(length - 2) * 8 - padding_bits;
1347 return true; 1355 return true;
1348 } 1356 }
1349 1357
1350 bool 1358 bool
1351 RTCPUtility::RTCPParserV2::ParseNACKItem() 1359 RTCPUtility::RTCPParserV2::ParseNACKItem()
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 const RTCPUtility::RtcpCommonHeader* 1711 const RTCPUtility::RtcpCommonHeader*
1704 RTCPUtility::RTCPPacketIterator::Current() { 1712 RTCPUtility::RTCPPacketIterator::Current() {
1705 if (!_ptrBlock) 1713 if (!_ptrBlock)
1706 { 1714 {
1707 return NULL; 1715 return NULL;
1708 } 1716 }
1709 1717
1710 return &_header; 1718 return &_header;
1711 } 1719 }
1712 } // namespace webrtc 1720 } // namespace webrtc
OLDNEW
« 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