| Index: webrtc/test/fuzzers/audio_decoder_opus_fuzzer.cc
|
| diff --git a/webrtc/test/fuzzers/vp8_qp_parser_fuzzer.cc b/webrtc/test/fuzzers/audio_decoder_opus_fuzzer.cc
|
| similarity index 52%
|
| copy from webrtc/test/fuzzers/vp8_qp_parser_fuzzer.cc
|
| copy to webrtc/test/fuzzers/audio_decoder_opus_fuzzer.cc
|
| index 5135f1a471ebc088e307441d2f45355d0dee6c9b..3d70ec507dfe5606120f6eb88d400e727d369ac9 100644
|
| --- a/webrtc/test/fuzzers/vp8_qp_parser_fuzzer.cc
|
| +++ b/webrtc/test/fuzzers/audio_decoder_opus_fuzzer.cc
|
| @@ -7,11 +7,17 @@
|
| * in the file PATENTS. All contributing project authors may
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
| -#include "webrtc/modules/video_coding/utility/vp8_header_parser.h"
|
| +
|
| +#include "webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.h"
|
| +#include "webrtc/test/fuzzers/audio_decoder_fuzzer.h"
|
|
|
| namespace webrtc {
|
| void FuzzOneInput(const uint8_t* data, size_t size) {
|
| - int qp;
|
| - vp8::GetQp(data, size, &qp);
|
| + const size_t channels = (size % 2) + 1; // 1 or 2 channels.
|
| + AudioDecoderOpus dec(channels);
|
| + const int kSampleRateHz = 48000;
|
| + const size_t kAllocatedOuputSizeSamples = kSampleRateHz / 10; // 100 ms.
|
| + int16_t output[kAllocatedOuputSizeSamples];
|
| + FuzzAudioDecoder(data, size, &dec, kSampleRateHz, sizeof(output), output);
|
| }
|
| } // namespace webrtc
|
|
|