OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |