Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quest/m1/fuzz-findings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ fixed the MKV block-header panic; its input is
## Required

- [moq-mux on a fixed mp4-atom](/quest/m1/fuzz-findings/mp4-atom-bump.md) - waiting on a 0.17.x release containing kixelated/mp4-atom#264 and #267, then moq-mux bumps to it and commits the `sgpd`, `iref` and `iloc` regressions
- [SPS fields cannot overflow](/quest/m1/fuzz-findings/sps-overflow.md) - hostile H.264 and H.265 SPS crop and size fields are refused instead of wrapping
- [mp4-atom iloc is bounded](/quest/m1/fuzz-findings/mp4-atom-iloc.md) - zero-size `iloc` extents cannot allocate megabytes from a few bytes; fixed upstream by kixelated/mp4-atom#267, finished by the mp4-atom bump
- [A catalog update reuses its encoder](/quest/m1/fuzz-findings/catalog-encoder.md) - republishing a compressed catalog or HLS group stops allocating a fresh DEFLATE encoder (about 200 KB) each time
45 changes: 0 additions & 45 deletions quest/m1/fuzz-findings/sps-overflow.md

This file was deleted.

6 changes: 4 additions & 2 deletions quest/m2/sps-fuzz-h264-reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

## Goal

The H.264 SPS fuzz target runs against moq-mux's parser after [moq-dev/moq#7398](https://github.com/moq-dev/moq/pull/7398) moves it onto `h264-reader`. Any overflow or panic it finds there is fixed in moq-mux's validation and recorded in the fuzz-findings SPS quest.
The H.264 SPS fuzz target runs against moq-mux's parser after [moq-dev/moq#7398](https://github.com/moq-dev/moq/pull/7398) moves it onto `h264-reader`. Any overflow or panic it finds there is fixed in moq-mux, with its input committed under `rs/moq-mux/fuzz/regressions/`.

## Plan

Decided 2026-10-30 (maintainer, follow-up planning): [moq-dev/moq#7313](https://github.com/moq-dev/moq/pull/7313) found the crop and width overflows in `h264-parser` ([therishidesai/h264-parser#9](https://github.com/therishidesai/h264-parser/issues/9)). #7398 replaces that crate for H.264, so the finding has to be rechecked on the new parser. Run the target long enough to cover the old reproducer and a fresh corpus. If `h264-reader` is clean, narrow the SPS quest to H.265.
Decided 2026-10-30 (maintainer, follow-up planning): [moq-dev/moq#7313](https://github.com/moq-dev/moq/pull/7313) found the crop and width overflows in `h264-parser` ([therishidesai/h264-parser#9](https://github.com/therishidesai/h264-parser/issues/9)). #7398 replaces that crate for H.264, so the finding has to be rechecked on the new parser. Run the target long enough to cover the old reproducer and a fresh corpus.

The H.265 half landed separately: moq-mux walks every H.265 SPS before scuffle_h265 parses it. For H.264, h264-reader 0.9 bounds `ue(v)` at 2^32 - 2 and computes the picture size with checked arithmetic, and the old reproducer is committed as `rs/moq-mux/fuzz/regressions/fmp4/h264-sps-width` and passes. That review was by reading the code, so this run is what confirms it.

Public API: none. Wire: none.
Binary file not shown.
Binary file added rs/moq-mux/fuzz/regressions/annexb/scuffle-expgolomb
Binary file not shown.
Binary file not shown.
Binary file added rs/moq-mux/fuzz/regressions/fmp4/h264-sps-width
Binary file not shown.
Binary file not shown.
17 changes: 8 additions & 9 deletions rs/moq-mux/src/codec/h265/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ pub use split::*;
use bytes::{Buf, Bytes, BytesMut};

use crate::codec::annexb::{InBandCodec, ParameterSets};
use scuffle_h265::{NALUnitType, SpsNALUnit};
use scuffle_h265::NALUnitType;
use sps::Sps;
pub(crate) use sps::id as sps_id;
pub(crate) use sps::{id as sps_id, parse_full as parse_full_sps};

/// Wrap one hvc1 (length-prefixed NALU) access unit as a single
/// [`Frame`](crate::container::Frame), with the keyframe flag set when it
Expand Down Expand Up @@ -286,23 +286,22 @@ pub(crate) fn config_from_sps(sps_nal: &[u8], in_band: bool) -> Result<hang::cat
///
/// `None` when the SPS fails to parse.
pub(crate) fn sps_reorder(nal: &[u8]) -> Option<crate::codec::video::Reorder> {
let sps = SpsNALUnit::parse(&mut &nal[..]).ok()?;
let highest = sps.rbsp.sps_max_sub_layers_minus1 as usize;
let reorder = &sps.rbsp.sub_layer_ordering_info.sps_max_num_reorder_pics;
let sps = parse_full_sps(nal).ok()?;
let highest = sps.sps_max_sub_layers_minus1 as usize;
let reorder = &sps.sub_layer_ordering_info.sps_max_num_reorder_pics;
let depth = *reorder.get(highest).or(reorder.last())?;
Some(crate::codec::video::Reorder {
depth: u32::try_from(depth).ok()?,
period: sps_period(&sps.rbsp),
period: sps_period(&sps),
})
}

/// The HRD an SPS NAL unit's VUI declares at its highest sub-layer, when it carries one: the
/// NAL HRD's last schedule, or the VCL HRD's when that is all there is.
pub(crate) fn sps_hrd(nal: &[u8]) -> Option<crate::codec::video::Hrd> {
let sps = SpsNALUnit::parse(&mut &nal[..]).ok()?;
let highest = sps.rbsp.sps_max_sub_layers_minus1 as usize;
let sps = parse_full_sps(nal).ok()?;
let highest = sps.sps_max_sub_layers_minus1 as usize;
let hrd = sps
.rbsp
.vui_parameters
.as_ref()?
.vui_timing_info
Expand Down
Loading
Loading