Fixed rtcp rpsi parsing of invalid packets.
Added packet type RpsiItem to destinguish parsed rpsi header and Rpsi body preventing handling two half-valid (header-only) rpsi packets as one valid, making test parser calculate rpsi packet once instead of twice. Added check padding bits doesn't exceed native bit string length. Marking rpsi received moved after it is validated. BUG=600977 Review URL: https://codereview.webrtc.org/1880443002 Cr-Commit-Position: refs/heads/master@{#12318}
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user