8 Commits

Author SHA1 Message Date
Michael Butler e4671da3fd #2801: merge main and preserve parser overflow regressions
Resolve the bitstream migration conflicts by retaining the craft-media
re-export and running the NAL regression tests against it. Drop the
obsolete proptest dependency and update the WASI testing documentation.

AI assistance: OpenAI Codex.
2026-10-24 20:26:01 -04:00
aiongg fa550ce2d0 Build: use craft-media for bitstream, isobmff and matroska (#2435)
* Build: use craft-media for bitstream, isobmff and matroska

filmcraft-bitstream, filmcraft-isobmff and filmcraft-matroska re-export
craft_media::{bitstream, isobmff, matroska} from craft-libs. The packages
and their public paths stay, so dependent crates build unchanged. The
integration tests in crates/isobmff/tests and crates/matroska/tests run
against the re-exports.

* Build: pin craft-media at 9db732e

craft-media spells the Matroska colour types in US English: Colour is
Color and VideoInfo::colour is VideoInfo::color. The spec names
element_ids::COLOUR, COLOUR_SPACE and VpcConfig::colour_primaries stay.

* matroska: the oracle skips the duration of a track's last frame

Ported from craft-media: the last audio or video frame of a track cut by
-t is shorter than a codec frame. ffmpeg 8 writes a shortened
BlockDuration and reports the codec frame duration; a remux by our writer
stores DefaultDuration and ffprobe reports the shortened one. Subtitle
cue durations are still compared. This fixes oracle::mjpeg_ac3 with
ffmpeg 8. The HDR test is named hevc_hdr_color, as in craft-media.

* matroska: laced_remux laces every audio track and checks timestamps

craft-media laces only tracks with a DefaultDuration. The remux gives
each audio track without one its mean packet spacing, so Vorbis, FLAC
and PCM lace too, and compares every packet's timestamp with the
source's. Ported from craft-media's oracle_matroska.rs.

* codecs: the Matroska audio timing test laces its Xiph case

craft-media laces only tracks with a DefaultDuration. The test's
Matroska helper sets the AAC access unit's duration (1024 samples,
rounded to the nanosecond), and the test checks that the Xiph-laced file
has laced blocks and the unlaced one has none.

* Build: repin craft-media to f97c84d27 (NAL length-size checks)

craft-libs#245 is on storytold/craft-libs main, so the dependency points there.

* Build: repin craft-media to f0ad6c1e1 (QuickTime v2 PCM entry limits)
2026-10-23 17:51:38 -04:00
Michael Butler 8dc619b76f codecs: prevent 32-bit length overflows (#2801)
Check NAL, VP9 superframe, AV1 tile and OBU lengths before slicing or converting. Add hostile-input regression tests and document running the parser tests on 32-bit WASI.

Targeted native and WASI tests pass. Full workspace CI is currently blocked by pre-existing UI Clippy diagnostics; this checkpoint is committed at the contributor’s explicit request before investigating the baseline separately.

Co-authored-by: Codex <noreply@openai.com>
2026-10-23 15:45:11 -04:00
Earl Co b28db6c4db fix(bitstream): reject invalid length-prefixed NAL widths (#2953)
* fix(bitstream): validate NAL prefix size

* bitstream: accept every NAL length width the avcC/hvcC field can declare (1 to 4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <brandon@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:54:32 -04:00
Earl Co 10c2e0255c security(bitstream): cache RBSP stop-bit lookup (#2880) 2026-10-23 10:54:27 -04:00
Marco Arnulfo 4d58c67745 fix(bitstream): map se(v) through the 64-bit codeNum so i32::MIN round-trips (fixes #1428) 2026-10-12 22:48:18 +02:00
Brandon Thomas b16e0889f3 Never crash: deny the panicking lints in the already-clean crates and apps
aac, bitstream, cfb, color, format, frame, geom, isobmff, media, scopes, speech, the desktop
app and the web app have no production unwrap/expect/panic/unreachable (the web app's two
`expect`s — frame-cache eviction and chunked file reads — become `let … else`); each now
carries `#![deny(clippy::unwrap_used, …)]` outside tests so it stays that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 16:08:23 -04:00
Brandon Thomas 936b28e4c4 M0.1/M0.2: workspace skeleton, time and bitstream crates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 05:33:20 -04:00