forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

segments.rs20 lines, 675 bytesHistoryRawDownload
1#![no_main]
2
3use ec_pgs::PgsDecoder;
4use libfuzzer_sys::fuzz_target;
5
6// Raw `.sup` bytes, split in two at a point the first byte picks, so a segment torn across two
7// `push` calls is reached. Every frame that comes out is drained as the stream goes.
8fuzz_target!(|data: &[u8]| {
9 let Some((&cut, _)) = data.split_first() else {
10 return;
11 };
12 let split = usize::from(cut) % (data.len() + 1);
13 let mut decoder = PgsDecoder::new();
14 for part in [&data[..split], &data[split..]] {
15 let _ = decoder.push(part);
16 while let Some(frame) = decoder.take_frame() {
17 std::hint::black_box((frame.width, frame.height));
18 }
19 }
20});