edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane fuzzh264: cargo-fuzz targets for ec-h264
Goal: DONE.md shared gate 2. One cargo-fuzz target per untrusted entry point of crate ec-h264.
Base sha: 3e6d0111 (main).
What changed
crates/ec-h264/fuzz/Cargo.toml: packageec-h264-fuzz,[package.metadata] cargo-fuzz = true,libfuzzer-sys 0.4, path deps onec-coreandec-h264, own[workspace] members = ["."].crates/ec-h264/fuzz/fuzz_targets/decode_annexb.rs: splits the raw bytes on Annex B start codes, pushes every NAL throughDecoder::push_nal(closing the picture and re-pushing onPictureBoundary), thenflushand drainsnext_frame.crates/ec-h264/fuzz/fuzz_targets/decode_avcc.rs: packet-levelH264Decoderas a demuxer drives it. Input byte 0 gives the avcC extradata length, then the avcC record, then one packet (length-prefixed NALs with a valid avcC, Annex B otherwise).crates/ec-h264/fuzz/seed.sh: copies 5 seed streams (CABA2_SVA_B, CANL3_SVA_B, BA3_SVA_C, SL1_SVA_B, AUD_MW_E .264, all under 200 KB) fromfixtures/vectors/h264-jvtintocorpus/decode_annexb/, and the same set intocorpus/decode_avcc/.crates/ec-h264/fuzz/.gitignore:target/,corpus/,artifacts/,coverage/.- Root
Cargo.toml:exclude = ["crates/*/fuzz"]added under[workspace]. - No
parse_naltarget: ec-h264 exposes no standalone SPS/PPS/slice-header parser (those live in ec-h264-syntax, not a public entry of this crate).
How to run
cd crates/ec-h264/fuzz && ./seed.sh && cargo +nightly fuzz run decode_annexb
cd crates/ec-h264/fuzz && ./seed.sh && cargo +nightly fuzz run decode_avcc
Via the server: scripts/remote-run.sh fuzzh264 -- bash -c 'cd crates/ec-h264/fuzz && ./seed.sh && cargo +nightly fuzz run <target> -- -max_total_time=120 -rss_limit_mb=3000 -timeout=10'
Smoke results (server, 120 s each, -rss_limit_mb=3000 -timeout=10)
| target | runs | final cov | final corpus | peak rss | exit | crashes/timeouts/OOM |
|---|---|---|---|---|---|---|
| decode_annexb | 1041 (8 exec/s) | 5257 | 655 units, 10 MB | 473 MB | 0 | none |
| decode_avcc | 6831 (56 exec/s) | 6687 | 785 units, 7.5 MB | 443 MB | 0 | none |
Observation: decode_annexb ran at about 8 exec/s, far below decode_avcc. Likely cause (not verified): mutated SPS dimensions drive large picture allocations (rss grows to ~470 MB). Worth a look in a later lane, not a crash.
Attempts that did not count: the first two decode_annexb runs found both server slots busy and host b rsync failed on another lane's path; one run was killed by the outer timeout, and the first local fallback ran without cargo-fuzz. The reported numbers come from the successful server runs.
Left
- No crashes found in the smoke window. Longer runs are the orchestrator's call.
- Corpus is not committed (seed.sh regenerates it).