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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 2912323003: Fix a bug in RtcEventLogSource (Closed)
Patch Set: Created 3 years, 7 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/audio_coding/neteq/tools/rtc_event_log_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_utility.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
index d003c0bdb0a511f2190b51e6b1b46e17297c518f..4cd61eccc2c80308a06df1c7cbb18f9c6c484eea 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -296,9 +296,14 @@ bool RtpHeaderParser::Parse(RTPHeader* header,
}
header->headerLength += XLen;
}
- if (header->headerLength + header->paddingLength >
- static_cast<size_t>(length))
+ // If the packet consists of only the header, then ignore the padding length.
+ // This is likely only happening when parsing a header-only rtpdump file,
+ // where the payloads have been stripped out.
+ if (header->headerLength != static_cast<size_t>(length) &&
danilchap 2017/05/31 17:30:21 this change looks dangerous to me: It will not be
danilchap 2017/05/31 18:57:14 Realized there is a simpler solution: if (headerLe
hlundin-webrtc 2017/05/31 21:02:56 But that solution does in fact parse out values th
danilchap 2017/06/01 09:45:15 HeaderParser need to fill RTPHeader structure and
+ header->headerLength + header->paddingLength >
+ static_cast<size_t>(length)) {
return false;
+ }
return true;
}
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698