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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.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, 5 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/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | webrtc/video/rampup_tests.cc » ('j') | 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 if (definedByProfile == kRtpOneByteHeaderExtensionId) { 349 if (definedByProfile == kRtpOneByteHeaderExtensionId) {
350 const uint8_t* ptrRTPDataExtensionEnd = ptr + XLen; 350 const uint8_t* ptrRTPDataExtensionEnd = ptr + XLen;
351 ParseOneByteExtensionHeader(header, 351 ParseOneByteExtensionHeader(header,
352 ptrExtensionMap, 352 ptrExtensionMap,
353 ptrRTPDataExtensionEnd, 353 ptrRTPDataExtensionEnd,
354 ptr); 354 ptr);
355 } 355 }
356 header.headerLength += XLen; 356 header.headerLength += XLen;
357 } 357 }
358 if (header.headerLength + header.paddingLength > static_cast<size_t>(length))
359 return false;
358 return true; 360 return true;
359 } 361 }
360 362
361 void RtpHeaderParser::ParseOneByteExtensionHeader( 363 void RtpHeaderParser::ParseOneByteExtensionHeader(
362 RTPHeader& header, 364 RTPHeader& header,
363 const RtpHeaderExtensionMap* ptrExtensionMap, 365 const RtpHeaderExtensionMap* ptrExtensionMap,
364 const uint8_t* ptrRTPDataExtensionEnd, 366 const uint8_t* ptrRTPDataExtensionEnd,
365 const uint8_t* ptr) const { 367 const uint8_t* ptr) const {
366 if (!ptrExtensionMap) { 368 if (!ptrExtensionMap) {
367 return; 369 return;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 return num_zero_bytes; 504 return num_zero_bytes;
503 } 505 }
504 ptr++; 506 ptr++;
505 num_zero_bytes++; 507 num_zero_bytes++;
506 } 508 }
507 return num_zero_bytes; 509 return num_zero_bytes;
508 } 510 }
509 } // namespace RtpUtility 511 } // namespace RtpUtility
510 512
511 } // namespace webrtc 513 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | webrtc/video/rampup_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698