Index: webrtc/test/fuzzers/audio_decoder_isac_fuzzer.cc |
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/audio_decoder_isac.cc b/webrtc/test/fuzzers/audio_decoder_isac_fuzzer.cc |
similarity index 56% |
copy from webrtc/modules/audio_coding/codecs/isac/main/source/audio_decoder_isac.cc |
copy to webrtc/test/fuzzers/audio_decoder_isac_fuzzer.cc |
index 8e0603e99ecd2ecdc06d52e8452cddf33f55caf6..984cfda398ce20367cd43a6e00d32120758a7595 100644 |
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/audio_decoder_isac.cc |
+++ b/webrtc/test/fuzzers/audio_decoder_isac_fuzzer.cc |
@@ -9,12 +9,14 @@ |
*/ |
#include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_decoder_isac.h" |
- |
-#include "webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t_impl.h" |
+#include "webrtc/test/fuzzers/audio_decoder_fuzzer.h" |
namespace webrtc { |
- |
-// Explicit instantiation: |
-template class AudioDecoderIsacT<IsacFloat>; |
- |
+void FuzzOneInput(const uint8_t* data, size_t size) { |
+ AudioDecoderIsac dec(nullptr); |
+ const int sample_rate_hz = size % 2 == 0 ? 16000 : 32000; // 16 or 32 kHz. |
+ static const size_t kAllocatedOuputSizeSamples = 32000 / 10; // 100 ms. |
+ int16_t output[kAllocatedOuputSizeSamples]; |
+ FuzzAudioDecoder(data, size, &dec, sample_rate_hz, sizeof(output), output); |
+} |
} // namespace webrtc |