forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

parse_obu.rs32 lines, 1.1 KiBHistoryRawDownload
1#![no_main]
2
3// Untrusted entry: a raw AV1 OBU stream (low-overhead bitstream format) through
4// the ec-av1-syntax parsers: the OBU framing of a whole temporal unit, then the
5// OBU header, leb128 size and sequence header read directly off the raw bytes.
6// Errors are expected for malformed input; only panics, hangs and OOM count.
7
8use ec_av1_syntax::obu::{self, ObuHeader};
9use ec_av1_syntax::sequence::SequenceHeader;
10use ec_av1_syntax::Av1Parser;
11use ec_core::bitio::BitReader;
12use libfuzzer_sys::fuzz_target;
13
14fuzz_target!(|data: &[u8]| {
15 let mut parser = Av1Parser::new();
16 if let Ok(obus) = parser.parse_temporal_unit(data) {
17 std::hint::black_box(obus.len());
18 }
19
20 let mut r = BitReader::new(data);
21 if let Ok(header) = ObuHeader::parse(&mut r) {
22 std::hint::black_box(header);
23 }
24 let mut r = BitReader::new(data);
25 if let Ok(size) = obu::read_leb128(&mut r) {
26 std::hint::black_box(size);
27 }
28 let mut r = BitReader::new(data);
29 if let Ok(seq) = SequenceHeader::parse(&mut r) {
30 std::hint::black_box(seq.max_frame_width.wrapping_mul(seq.max_frame_height));
31 }
32});