blob: 952d719f6fe8cd6f12445a7b80e211453a1b3a9f [file] [log] [blame]
mmoroze87d66d52016-02-05 19:10:571// Copyright 2015 The Chromium Authors. All rights reserved.
krasin68cab89b2015-10-23 22:15:562// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
mmoroze87d66d52016-02-05 19:10:575#include <stddef.h>
6#include <stdint.h>
7
krasin68cab89b2015-10-23 22:15:568#include "base/bind.h"
9#include "media/formats/mp2t/es_parser_h264.h"
10
11static void NewVideoConfig(const media::VideoDecoderConfig& config) {}
12static void EmitBuffer(scoped_refptr<media::StreamParserBuffer> buffer) {}
13
14// Entry point for LibFuzzer.
mmoroze87d66d52016-02-05 19:10:5715extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
krasin68cab89b2015-10-23 22:15:5616 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}