webrtc_m130/test/fuzzers/aec3_config_json_fuzzer.cc
Sam Zackrisson db8df17650 Add AEC3 config json parsing fuzzer
Bug: webrtc:9535
Change-Id: Ic659a31b6d5b26a07aee955a5b83e889122b4705
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157306
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29520}
2019-10-17 16:33:44 +00:00

31 lines
932 B
C++

/*
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <string>
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_canceller3_config_json.h"
#include "test/fuzzers/fuzz_data_helper.h"
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
if (size > 10000) {
return;
}
std::string config_json(reinterpret_cast<const char*>(data), size);
EchoCanceller3Config config;
bool success;
Aec3ConfigFromJsonString(config_json, &config, &success);
EchoCanceller3Config::Validate(&config);
}
} // namespace webrtc