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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 const int id = (*ptr & 0xf0) >> 4; | 312 const int id = (*ptr & 0xf0) >> 4; |
313 const int len = (*ptr & 0x0f); | 313 const int len = (*ptr & 0x0f); |
314 ptr++; | 314 ptr++; |
315 | 315 |
316 if (id == 15) { | 316 if (id == 15) { |
317 LOG(LS_WARNING) | 317 LOG(LS_WARNING) |
318 << "RTP extension header 15 encountered. Terminate parsing."; | 318 << "RTP extension header 15 encountered. Terminate parsing."; |
319 return; | 319 return; |
320 } | 320 } |
321 | 321 |
| 322 if (ptrRTPDataExtensionEnd - ptr < (len + 1)) { |
| 323 LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len + 1) |
| 324 << ", bytes left in buffer: " |
| 325 << (ptrRTPDataExtensionEnd - ptr); |
| 326 return; |
| 327 } |
| 328 |
322 RTPExtensionType type; | 329 RTPExtensionType type; |
323 if (ptrExtensionMap->GetType(id, &type) != 0) { | 330 if (ptrExtensionMap->GetType(id, &type) != 0) { |
324 // If we encounter an unknown extension, just skip over it. | 331 // If we encounter an unknown extension, just skip over it. |
325 LOG(LS_WARNING) << "Failed to find extension id: " << id; | 332 LOG(LS_WARNING) << "Failed to find extension id: " << id; |
326 } else { | 333 } else { |
327 switch (type) { | 334 switch (type) { |
328 case kRtpExtensionTransmissionTimeOffset: { | 335 case kRtpExtensionTransmissionTimeOffset: { |
329 if (len != 2) { | 336 if (len != 2) { |
330 LOG(LS_WARNING) << "Incorrect transmission time offset len: " | 337 LOG(LS_WARNING) << "Incorrect transmission time offset len: " |
331 << len; | 338 << len; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 if (*ptr != 0) { | 434 if (*ptr != 0) { |
428 return num_zero_bytes; | 435 return num_zero_bytes; |
429 } | 436 } |
430 ptr++; | 437 ptr++; |
431 num_zero_bytes++; | 438 num_zero_bytes++; |
432 } | 439 } |
433 return num_zero_bytes; | 440 return num_zero_bytes; |
434 } | 441 } |
435 } // namespace RtpUtility | 442 } // namespace RtpUtility |
436 } // namespace webrtc | 443 } // namespace webrtc |
OLD | NEW |