| Index: media/test/pipeline_integration_fuzzertest.cc
|
| diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc
|
| index b9fa6b7c5469b03c36817998f58a9d0c348689d5..50d08ef608f98b0831fdbcdce1910020d4c033af 100644
|
| --- a/media/test/pipeline_integration_fuzzertest.cc
|
| +++ b/media/test/pipeline_integration_fuzzertest.cc
|
| @@ -2,12 +2,26 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <vector>
|
| +
|
| #include "base/at_exit.h"
|
| +#include "base/bind.h"
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| +#include "media/base/eme_constants.h"
|
| #include "media/base/pipeline_status.h"
|
| #include "media/test/pipeline_integration_test_base.h"
|
|
|
| +namespace {
|
| +
|
| +void OnEncryptedMediaInitData(media::PipelineIntegrationTestBase* test,
|
| + media::EmeInitDataType /* type */,
|
| + const std::vector<uint8_t>& /* init_data */) {
|
| + test->OnError(media::PIPELINE_ERROR_INITIALIZATION_FAILED);
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| // Entry point for LibFuzzer.
|
| extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
| // Media pipeline starts new threads, which needs AtExitManager.
|
| @@ -18,6 +32,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
|
| media::PipelineIntegrationTestBase test;
|
|
|
| + test.set_encrypted_media_init_data_cb(
|
| + base::Bind(&OnEncryptedMediaInitData, &test));
|
| +
|
| media::PipelineStatus pipeline_status =
|
| test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
|
| if (pipeline_status != media::PIPELINE_OK)
|
|
|