mmoroz | e87d66d5 | 2016-02-05 19:10:57 | [diff] [blame^] | 1 | // Copyright 2015 The Chromium Authors. All rights reserved. |
krasin | 68cab89b | 2015-10-23 22:15:56 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
mmoroz | e87d66d5 | 2016-02-05 19:10:57 | [diff] [blame^] | 5 | #include <stddef.h> |
| 6 | #include <stdint.h> |
| 7 | |
krasin | 68cab89b | 2015-10-23 22:15:56 | [diff] [blame] | 8 | #include "base/bind.h" |
| 9 | #include "media/formats/mp2t/es_parser_h264.h" |
| 10 | |
| 11 | static void NewVideoConfig(const media::VideoDecoderConfig& config) {} |
| 12 | static void EmitBuffer(scoped_refptr<media::StreamParserBuffer> buffer) {} |
| 13 | |
| 14 | // Entry point for LibFuzzer. |
mmoroz | e87d66d5 | 2016-02-05 19:10:57 | [diff] [blame^] | 15 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
krasin | 68cab89b | 2015-10-23 22:15:56 | [diff] [blame] | 16 | media::mp2t::EsParserH264 es_parser(base::Bind(&NewVideoConfig), |
| 17 | base::Bind(&EmitBuffer)); |
| 18 | if (!es_parser.Parse(data, size, media::kNoTimestamp(), |
| 19 | media::kNoDecodeTimestamp())) { |
| 20 | return 0; |
| 21 | } |
| 22 | return 0; |
| 23 | } |