Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: webrtc/test/fuzzers/audio_decoder_isac_fuzzer.cc

Issue 1499093002: Create fuzzer tests for audio decoders (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add a public_configs element to webrtc_fuzzer_main Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698