Commit bbcaf411 authored by Janne Grunau's avatar Janne Grunau

fuzzer: use dav1d_parse_sequence_header()

Should increase function coverage in oss-fuzz to 100%.
parent b7c64ad6
......@@ -61,6 +61,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
Dav1dContext * ctx = NULL;
Dav1dPicture pic;
const uint8_t *ptr = data;
int have_seq_hdr = 0;
int err;
dav1d_version();
......@@ -102,6 +103,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
if (!frame_size) continue;
if (!have_seq_hdr) {
Dav1dSequenceHeader seq = { 0 };
int err = dav1d_parse_sequence_header(&seq, ptr, frame_size);
// skip frames until we see a sequence header
if (err != 0) {
ptr += frame_size;
continue;
}
have_seq_hdr = 1;
}
// copy frame data to a new buffer to catch reads past the end of input
p = dav1d_data_create(&buf, frame_size);
if (!p) goto cleanup;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment