initial commit
Signed-off-by: Kamal Tufekcic <kamal@lo.sh>
This commit is contained in:
commit
7862cb1d9d
2884 changed files with 16797 additions and 0 deletions
26
fuzz/fuzz_targets/decode_arbitrary.rs
Normal file
26
fuzz/fuzz_targets/decode_arbitrary.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//! Fuzzer for `decode_frame` against arbitrary byte input.
|
||||
//!
|
||||
//! Drives the frame parser and Rice bitstream decoder with random bytes.
|
||||
//! The decoder must never panic, allocate unboundedly, or enter an infinite
|
||||
//! loop on any input: success is "returns `Ok` with valid samples" or
|
||||
//! "returns `Err(DecodeError)`". Nothing else is acceptable.
|
||||
//!
|
||||
//! Paths exercised:
|
||||
//! - Every header validation branch (sync, order range, partition order
|
||||
//! range, truncation at each field boundary, partition count vs. sample
|
||||
//! count mismatch).
|
||||
//! - The Rice unary-decode loop with pathological run lengths (the
|
||||
//! `q > 2^26` guard in `rice::rice_decode` is specifically targeted).
|
||||
//! - The Q15 predictor accumulator on adversarial coefficient and residual
|
||||
//! values (overflow / wrap-around checks).
|
||||
|
||||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
// Only the `Ok` / `Err` result is meaningful; panics are the failure
|
||||
// mode. The returned samples themselves are unchecked here — the
|
||||
// `roundtrip_arbitrary` target verifies encoder/decoder self-consistency.
|
||||
let _ = lac::decode_frame(data);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue