| Index: media/test/pipeline_integration_fuzzertest.cc
|
| diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b9fa6b7c5469b03c36817998f58a9d0c348689d5
|
| --- /dev/null
|
| +++ b/media/test/pipeline_integration_fuzzertest.cc
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "base/at_exit.h"
|
| +#include "base/command_line.h"
|
| +#include "base/logging.h"
|
| +#include "media/base/pipeline_status.h"
|
| +#include "media/test/pipeline_integration_test_base.h"
|
| +
|
| +// Entry point for LibFuzzer.
|
| +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
| + // Media pipeline starts new threads, which needs AtExitManager.
|
| + base::AtExitManager at_exit;
|
| +
|
| + // Media pipeline checks command line arguments internally.
|
| + base::CommandLine::Init(0, nullptr);
|
| +
|
| + media::PipelineIntegrationTestBase test;
|
| +
|
| + media::PipelineStatus pipeline_status =
|
| + test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
|
| + if (pipeline_status != media::PIPELINE_OK)
|
| + return 0;
|
| +
|
| + test.Play();
|
| + pipeline_status = test.WaitUntilEndedOrError();
|
| + if (pipeline_status != media::PIPELINE_OK)
|
| + return 0;
|
| +
|
| + test.Seek(base::TimeDelta());
|
| +
|
| + return 0;
|
| +}
|
|
|