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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 2912323003: Fix a bug in RtcEventLogSource (Closed)
Patch Set: Created 3 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 static constexpr uint16_t kRtpOneByteHeaderExtensionId = 0xBEDE; 289 static constexpr uint16_t kRtpOneByteHeaderExtensionId = 0xBEDE;
290 if (definedByProfile == kRtpOneByteHeaderExtensionId) { 290 if (definedByProfile == kRtpOneByteHeaderExtensionId) {
291 const uint8_t* ptrRTPDataExtensionEnd = ptr + XLen; 291 const uint8_t* ptrRTPDataExtensionEnd = ptr + XLen;
292 ParseOneByteExtensionHeader(header, 292 ParseOneByteExtensionHeader(header,
293 ptrExtensionMap, 293 ptrExtensionMap,
294 ptrRTPDataExtensionEnd, 294 ptrRTPDataExtensionEnd,
295 ptr); 295 ptr);
296 } 296 }
297 header->headerLength += XLen; 297 header->headerLength += XLen;
298 } 298 }
299 if (header->headerLength + header->paddingLength > 299 // If the packet consists of only the header, then ignore the padding length.
300 static_cast<size_t>(length)) 300 // This is likely only happening when parsing a header-only rtpdump file,
301 // where the payloads have been stripped out.
302 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
303 header->headerLength + header->paddingLength >
304 static_cast<size_t>(length)) {
301 return false; 305 return false;
306 }
302 return true; 307 return true;
303 } 308 }
304 309
305 void RtpHeaderParser::ParseOneByteExtensionHeader( 310 void RtpHeaderParser::ParseOneByteExtensionHeader(
306 RTPHeader* header, 311 RTPHeader* header,
307 const RtpHeaderExtensionMap* ptrExtensionMap, 312 const RtpHeaderExtensionMap* ptrExtensionMap,
308 const uint8_t* ptrRTPDataExtensionEnd, 313 const uint8_t* ptrRTPDataExtensionEnd,
309 const uint8_t* ptr) const { 314 const uint8_t* ptr) const {
310 if (!ptrExtensionMap) { 315 if (!ptrExtensionMap) {
311 return; 316 return;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 return; 489 return;
485 } 490 }
486 } 491 }
487 } 492 }
488 ptr += (len + 1); 493 ptr += (len + 1);
489 } 494 }
490 } 495 }
491 496
492 } // namespace RtpUtility 497 } // namespace RtpUtility
493 } // namespace webrtc 498 } // namespace webrtc
OLDNEW
« 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