Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
|
xhwang
2016/03/02 00:57:04
What's the recommendation about the location of th
kcc2
2016/03/02 01:00:11
My recommendation is to keep the fuzzing targets c
xhwang
2016/03/02 01:20:41
Done.
| |
| 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, NULL); | |
|
DaleCurtis
2016/03/02 01:05:39
nullptr ?
xhwang
2016/03/02 01:20:41
Done.
| |
| 18 | |
| 19 media::PipelineIntegrationTestBase test; | |
| 20 | |
| 21 DVLOG(1) << "Start"; | |
|
kcc2
2016/03/02 01:00:11
No logging please -- it just slows down fuzzing.
xhwang
2016/03/02 01:20:41
Done.
| |
| 22 media::PipelineStatus pipeline_status = | |
| 23 test.Start(data, size, media::PipelineIntegrationTestBase::kClockless); | |
| 24 if (pipeline_status != media::PIPELINE_OK) | |
| 25 return 0; | |
| 26 | |
| 27 DVLOG(1) << "Play"; | |
| 28 test.Play(); | |
| 29 pipeline_status = test.WaitUntilEndedOrError(); | |
| 30 if (pipeline_status != media::PIPELINE_OK) | |
| 31 return 0; | |
| 32 | |
| 33 DVLOG(1) << "Seek"; | |
| 34 test.Seek(base::TimeDelta::FromMilliseconds(0)); | |
|
DaleCurtis
2016/03/02 01:05:39
Also just base::TimeDelta() here.
xhwang
2016/03/02 01:20:41
Done.
| |
| 35 | |
| 36 return 0; | |
| 37 } | |
| OLD | NEW |