Files
Álvaro Velad Galván 734bebf310 fix(CEA): Read each trun from its own data offset in shared mdat (#10295)
Mp4CeaParser assumed the samples described across multiple trun boxes
were contiguous in the mdat and only seeked to the first trun's data
offset. When a track's runs are interleaved with another track's data in
a shared mdat (as in Apple HLS streams, which place the CEA-608 'c608'
track's runs between the video runs), the second and later samples were
read from the neighboring track's bytes.

On the raw CEA-608 ('c608') path this fed video bytes into the 608
decoder; stray pairs that happened to pass the parity check were decoded
as characters, rendering garbage (e.g. "úX") plus a stack of empty rows
above the real caption. The SEI path had the same latent assumption and
could misread NAL units.

Both `parseC608Mdat_` and `parseMdat_` now read each run starting from
its own trun data offset; parseMdat_ additionally bounds the NAL walk by
each sample size so it never reads past a run into another track's data.
The now-unused getSampleData_ helper is removed.

Adds regression tests with crafted segments whose runs are
non-contiguous, for both the RAW608 and SEI paths.
2026-07-12 10:06:44 -07:00
..