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

Unified Diff: webrtc/video/rampup_tests.cc

Issue 1220863002: Fail RTP parsing on excessive padding length. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: move paddingLength to + side Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_utility.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/rampup_tests.cc
diff --git a/webrtc/video/rampup_tests.cc b/webrtc/video/rampup_tests.cc
index e4da197537dfff234610f22e4ac0cc56cea1315d..44cbb705ffec2a6a930b7618fe71901d2bfdf620 100644
--- a/webrtc/video/rampup_tests.cc
+++ b/webrtc/video/rampup_tests.cc
@@ -131,7 +131,9 @@ bool StreamObserver::SendRtp(const uint8_t* packet, size_t length) {
++total_packets_sent_;
if (header.paddingLength > 0)
++padding_packets_sent_;
- if (rtx_media_ssrcs_.find(header.ssrc) != rtx_media_ssrcs_.end()) {
+ // Handle RTX retransmission, but only for non-padding-only packets.
+ if (rtx_media_ssrcs_.find(header.ssrc) != rtx_media_ssrcs_.end() &&
+ header.headerLength + header.paddingLength != length) {
rtx_media_sent_ += length - header.headerLength - header.paddingLength;
if (header.paddingLength == 0)
++rtx_media_packets_sent_;
@@ -141,9 +143,8 @@ bool StreamObserver::SendRtp(const uint8_t* packet, size_t length) {
EXPECT_TRUE(payload_registry_->RestoreOriginalPacket(
&restored_packet_ptr, packet, &restored_length,
rtx_media_ssrcs_[header.ssrc], header));
- length = restored_length;
- EXPECT_TRUE(rtp_parser_->Parse(
- restored_packet, static_cast<int>(length), &header));
+ EXPECT_TRUE(
+ rtp_parser_->Parse(restored_packet_ptr, restored_length, &header));
} else {
rtp_rtcp_->SetRemoteSSRC(header.ssrc);
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_utility.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698