Fixed busy loop in case of partially malformed rtcp packet

BUG=webrtc:5574

Review URL: https://codereview.webrtc.org/1726573003

Cr-Commit-Position: refs/heads/master@{#11946}
This commit is contained in:
danilchap
2016-03-10 13:13:52 -08:00
committed by Commit bot
parent bb9edbd048
commit 50da1d329a
2 changed files with 8 additions and 0 deletions

View File

@ -157,6 +157,13 @@ TEST_F(RtcpReceiverTest, BrokenPacketIsIgnored) {
EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
}
TEST_F(RtcpReceiverTest, InvalidFeedbackPacketIsIgnored) {
// Too short feedback packet.
const uint8_t bad_packet[] = {0x80, RTCPUtility::PT_RTPFB, 0, 0};
EXPECT_EQ(0, InjectRtcpPacket(bad_packet, sizeof(bad_packet)));
EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
}
TEST_F(RtcpReceiverTest, InjectSrPacket) {
const uint32_t kSenderSsrc = 0x10203;
rtcp::SenderReport sr;