Filter out the non-RTP packet in RtpTransport.

Bug: b/77547687
Change-Id: Id13b4f918208b76040bfbef1ec771f2a42831519
Reviewed-on: https://webrtc-review.googlesource.com/66602
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22714}
This commit is contained in:
Zhi Huang 2018-04-03 18:15:36 -07:00 committed by Commit Bot
parent b65dcb5226
commit 259073bf82

View File

@ -230,6 +230,11 @@ void RtpTransport::OnReadPacket(rtc::PacketTransportInternal* transport,
int flags) {
TRACE_EVENT0("webrtc", "RtpTransport::OnReadPacket");
if (!cricket::IsRtpPacket(data, len) &&
!IsRtcp(data, static_cast<int>(len))) {
return;
}
// When using RTCP multiplexing we might get RTCP packets on the RTP
// transport. We check the RTP payload type to determine if it is RTCP.
bool rtcp = transport == rtcp_packet_transport() ||
@ -239,6 +244,7 @@ void RtpTransport::OnReadPacket(rtc::PacketTransportInternal* transport,
if (!WantsPacket(rtcp, &packet)) {
return;
}
// This mutates |packet| if it is protected.
SignalPacketReceived(rtcp, &packet, packet_time);
}