mirror of
https://github.com/freemkv/libfreemkv.git
synced 2026-10-07 18:13:10 +00:00
Security - Remove the unsafe Vec::set_len over recycled sector buffers — UB reachable from safe code (GHSA-j8ww-f5fg-9pmh, low). Uses Vec::resize; pooling unchanged. CI / tooling - clippy on stable with the MSRV single-sourced from Cargo.toml; cargo-deny dependency-audit gate with first-party git sources allowed (#15); audience-based comment-guard (#17). Docs - README (keydb ownership, BD-J parser count), drive-access transport/reset notes, mux timeline module-doc links.
17 lines
932 B
Markdown
17 lines
932 B
Markdown
# FLAC elementary-stream decodability gate (`src/mux/codec/flac.rs`)
|
|
|
|
FLAC frames carry no length field, so a raw stream is delimited only by
|
|
sync-scanning + CRC validation. In freemkv, though, FLAC never arrives raw:
|
|
it comes from mp4/mkv, where each packet is exactly one container-delimited
|
|
FLAC frame (a complete, pre-delimited frame per packet). So this parser
|
|
is a per-packet gate, not a framer: every FLAC frame ends with a 16-bit CRC
|
|
(poly 0x8005, init 0, non-reflected) computed so the residue over the whole
|
|
frame — footer CRC included — is zero (per the FLAC format specification,
|
|
RFC 9639, frame footer). A nonzero residue is definitive corruption → drop
|
|
the frame (a silence gap, never a shift — each packet keeps its own PTS),
|
|
logged via the shared tally.
|
|
|
|
A packet that does not begin with the FLAC frame sync is not a delimited
|
|
frame we can validate, so it is passed through unchanged (never
|
|
false-dropped).
|