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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const int id = (*ptr & 0xf0) >> 4; | 316 const int id = (*ptr & 0xf0) >> 4; |
317 const int len = (*ptr & 0x0f); | 317 const int len = (*ptr & 0x0f); |
318 ptr++; | 318 ptr++; |
319 | 319 |
320 if (id == 15) { | 320 if (id == 15) { |
321 LOG(LS_WARNING) | 321 LOG(LS_WARNING) |
322 << "RTP extension header 15 encountered. Terminate parsing."; | 322 << "RTP extension header 15 encountered. Terminate parsing."; |
323 return; | 323 return; |
324 } | 324 } |
325 | 325 |
| 326 if (ptrRTPDataExtensionEnd - ptr < (len + 1)) { |
| 327 LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len + 1) |
| 328 << ", bytes left in buffer: " |
| 329 << (ptrRTPDataExtensionEnd - ptr); |
| 330 return; |
| 331 } |
| 332 |
326 RTPExtensionType type; | 333 RTPExtensionType type; |
327 if (ptrExtensionMap->GetType(id, &type) != 0) { | 334 if (ptrExtensionMap->GetType(id, &type) != 0) { |
328 // If we encounter an unknown extension, just skip over it. | 335 // If we encounter an unknown extension, just skip over it. |
329 LOG(LS_WARNING) << "Failed to find extension id: " << id; | 336 LOG(LS_WARNING) << "Failed to find extension id: " << id; |
330 } else { | 337 } else { |
331 switch (type) { | 338 switch (type) { |
332 case kRtpExtensionTransmissionTimeOffset: { | 339 case kRtpExtensionTransmissionTimeOffset: { |
333 if (len != 2) { | 340 if (len != 2) { |
334 LOG(LS_WARNING) << "Incorrect transmission time offset len: " | 341 LOG(LS_WARNING) << "Incorrect transmission time offset len: " |
335 << len; | 342 << len; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if (*ptr != 0) { | 457 if (*ptr != 0) { |
451 return num_zero_bytes; | 458 return num_zero_bytes; |
452 } | 459 } |
453 ptr++; | 460 ptr++; |
454 num_zero_bytes++; | 461 num_zero_bytes++; |
455 } | 462 } |
456 return num_zero_bytes; | 463 return num_zero_bytes; |
457 } | 464 } |
458 } // namespace RtpUtility | 465 } // namespace RtpUtility |
459 } // namespace webrtc | 466 } // namespace webrtc |
OLD | NEW |