Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: media/filters/vp8_parser_fuzzertest.cc

Issue 1770583002: Add fuzzer test for various media parsers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <stddef.h>
6 #include <stdint.h>
7
8 #include "base/numerics/safe_conversions.h"
9 #include "media/filters/ivf_parser.h"
10 #include "media/filters/vp8_parser.h"
11
12 // Entry point for LibFuzzer.
13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
14 const uint8_t* ivf_payload = nullptr;
15 media::IvfParser ivf_parser;
16 media::IvfFileHeader ivf_file_header;
17 media::IvfFrameHeader ivf_frame_header;
18
19 if (!ivf_parser.Initialize(data, size, &ivf_file_header))
20 return 0;
21 if (ivf_file_header.fourcc != 0x30385056u) // VP80
DaleCurtis 2016/03/05 01:30:06 Does this trigger a dcheck otherwise? Seems you co
jrummell 2016/03/07 20:07:28 Since we're testing with random files, I removed t
22 return 0;
23
24 // Parse until the end of stream/unsupported stream/error in stream is found.
25 while (ivf_parser.ParseNextFrame(&ivf_frame_header, &ivf_payload)) {
26 media::Vp8Parser vp8_parser;
27 media::Vp8FrameHeader vp8_frame_header;
28 vp8_parser.ParseFrame(ivf_payload, ivf_frame_header.frame_size,
29 &vp8_frame_header);
30 }
31
32 return 0;
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698