OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
11 #include "webrtc/test/fuzzers/audio_decoder_fuzzer.h" | 11 #include "webrtc/test/fuzzers/audio_decoder_fuzzer.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 | 14 |
15 #include "webrtc/api/audio_codecs/audio_decoder.h" | 15 #include "webrtc/api/audio_codecs/audio_decoder.h" |
16 #include "webrtc/base/checks.h" | |
17 #include "webrtc/base/optional.h" | |
18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 16 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| 17 #include "webrtc/rtc_base/checks.h" |
| 18 #include "webrtc/rtc_base/optional.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 namespace { | 21 namespace { |
22 template <typename T, unsigned int B = sizeof(T)> | 22 template <typename T, unsigned int B = sizeof(T)> |
23 bool ParseInt(const uint8_t** data, size_t* remaining_size, T* value) { | 23 bool ParseInt(const uint8_t** data, size_t* remaining_size, T* value) { |
24 static_assert(std::numeric_limits<T>::is_integer, "Type must be an integer."); | 24 static_assert(std::numeric_limits<T>::is_integer, "Type must be an integer."); |
25 static_assert(sizeof(T) <= sizeof(uint64_t), | 25 static_assert(sizeof(T) <= sizeof(uint64_t), |
26 "Cannot read wider than uint64_t."); | 26 "Cannot read wider than uint64_t."); |
27 static_assert(B <= sizeof(T), "T must be at least B bytes wide."); | 27 static_assert(B <= sizeof(T), "T must be at least B bytes wide."); |
28 if (B > *remaining_size) | 28 if (B > *remaining_size) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 break; | 90 break; |
91 if (remaining_size < packet_len) | 91 if (remaining_size < packet_len) |
92 break; | 92 break; |
93 decoder->IncomingPacket(data_ptr, packet_len, rtp_sequence_number, | 93 decoder->IncomingPacket(data_ptr, packet_len, rtp_sequence_number, |
94 rtp_timestamp, arrival_timestamp); | 94 rtp_timestamp, arrival_timestamp); |
95 data_ptr += packet_len; | 95 data_ptr += packet_len; |
96 remaining_size -= packet_len; | 96 remaining_size -= packet_len; |
97 } | 97 } |
98 } | 98 } |
99 } // namespace webrtc | 99 } // namespace webrtc |
OLD | NEW |