| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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_processing_fuzzer.h" | 11 #include "webrtc/test/fuzzers/audio_processing_fuzzer.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <array> | 14 #include <array> |
| 15 #include <cmath> | 15 #include <cmath> |
| 16 | 16 |
| 17 #include "webrtc/base/checks.h" | |
| 18 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 17 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 19 #include "webrtc/modules/include/module_common_types.h" | 18 #include "webrtc/modules/include/module_common_types.h" |
| 19 #include "webrtc/rtc_base/checks.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 namespace { | 22 namespace { |
| 23 size_t ByteToNativeRate(uint8_t data) { | 23 size_t ByteToNativeRate(uint8_t data) { |
| 24 using Rate = AudioProcessing::NativeRate; | 24 using Rate = AudioProcessing::NativeRate; |
| 25 switch (data % 4) { | 25 switch (data % 4) { |
| 26 case 0: | 26 case 0: |
| 27 // Breaks AEC3. | 27 // Breaks AEC3. |
| 28 // return static_cast<size_t>(Rate::kSampleRate8kHz); | 28 // return static_cast<size_t>(Rate::kSampleRate8kHz); |
| 29 case 1: | 29 case 1: |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 size_t size, | 148 size_t size, |
| 149 std::unique_ptr<AudioProcessing> apm) { | 149 std::unique_ptr<AudioProcessing> apm) { |
| 150 const auto is_float = ParseBool(&data, &size); | 150 const auto is_float = ParseBool(&data, &size); |
| 151 if (!is_float) { | 151 if (!is_float) { |
| 152 return; | 152 return; |
| 153 } | 153 } |
| 154 | 154 |
| 155 FuzzAudioProcessing(data, size, *is_float, apm.get()); | 155 FuzzAudioProcessing(data, size, *is_float, apm.get()); |
| 156 } | 156 } |
| 157 } // namespace webrtc | 157 } // namespace webrtc |
| OLD | NEW |