forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

page_parse.rs20 lines, 661 bytesHistoryRawDownload
1#![no_main]
2
3use ec_ogg::{PageHeader, xiph_unlace};
4use libfuzzer_sys::fuzz_target;
5
6/// Bytes before the segment table in a page (RFC 3533 section 6); the library keeps this private.
7const HEADER_LEN: usize = 27;
8
9// The fixed header, then the segment table it announces, then Xiph extradata.
10fuzz_target!(|data: &[u8]| {
11 if let Ok((mut header, nsegs)) = PageHeader::parse_fixed(data) {
12 let Some(table) = data.get(HEADER_LEN..HEADER_LEN + nsegs) else {
13 return;
14 };
15 header.segments = table.to_vec();
16 let _ = header.body_len();
17 let _ = PageHeader::stored_crc(data);
18 }
19 let _ = xiph_unlace(data);
20});