Add an input size limit to APM fuzzer

The fuzzer times out on too long inputs.
This CL limits tests to 400 000 bytes, ~ 12 seconds of 8 kHz float audio.

Bug: chromium:940209
Change-Id: I86b772f9d8989a8b129d933d25ece3631a6a365f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126780
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27059}
This commit is contained in:
Sam Zackrisson
2019-03-11 13:47:54 +01:00
committed by Commit Bot
parent a5c0ba1861
commit d71edac904

View File

@ -150,6 +150,9 @@ std::unique_ptr<AudioProcessing> CreateApm(test::FuzzDataHelper* fuzz_data,
} // namespace
void FuzzOneInput(const uint8_t* data, size_t size) {
if (size > 400000) {
return;
}
test::FuzzDataHelper fuzz_data(rtc::ArrayView<const uint8_t>(data, size));
// This string must be in scope during execution, according to documentation
// for field_trial.h. Hence it's created here and not in CreateApm.