| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" |
| 7 #include "base/logging.h" |
| 8 #include "media/base/pipeline_status.h" |
| 9 #include "media/test/pipeline_integration_test_base.h" |
| 10 |
| 11 // Entry point for LibFuzzer. |
| 12 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| 13 // Media pipeline starts new threads, which needs AtExitManager. |
| 14 base::AtExitManager at_exit; |
| 15 |
| 16 // Media pipeline checks command line arguments internally. |
| 17 base::CommandLine::Init(0, nullptr); |
| 18 |
| 19 media::PipelineIntegrationTestBase test; |
| 20 |
| 21 media::PipelineStatus pipeline_status = |
| 22 test.Start(data, size, media::PipelineIntegrationTestBase::kClockless); |
| 23 if (pipeline_status != media::PIPELINE_OK) |
| 24 return 0; |
| 25 |
| 26 test.Play(); |
| 27 pipeline_status = test.WaitUntilEndedOrError(); |
| 28 if (pipeline_status != media::PIPELINE_OK) |
| 29 return 0; |
| 30 |
| 31 test.Seek(base::TimeDelta()); |
| 32 |
| 33 return 0; |
| 34 } |
| OLD | NEW |