Files
deckcraft/crates
marshiyar ede7a7ead7 ogg: bound damage recovery work and the warnings list
What was wrong: when a page failed its CRC the demuxer had already read the
whole page (up to about 64 KiB), then moved on by one byte and tried again.
Nothing was charged for it, and only the scan for the next capture pattern had
a budget, which a candidate that matches "OggS" at the current position never
reaches. A file made of capture patterns 64 bytes apart, each claiming a full
page, made a 1 MB file read about 957 MB and compute a CRC over all of it. The
warnings list also grew with every damaged page, without limit.

What changed: the per-file recovery budget (32 MiB, the scan's existing one) is
now also charged with the length of every page read only to find its CRC wrong.
When it is spent the pages found so far are returned with a warning saying the
rest was not searched. At most 256 warnings are kept, plus one saying the rest
were dropped.

How it was tested: two new tests failed before the fix and pass after it, a
counting ByteSource over 1 MB of dense fake pages (bytes read stay within the
budget; before, 957 MB were read) and 100,000 bad-CRC pages (before, 199,999
warnings). A file of good pages is not charged and has no warnings. The other
ogg tests still pass, and clippy is clean with -D warnings.

Completes the Ogg part of storytold/filmcraft#2794
2026-10-30 18:27:08 -07:00
..
2026-10-28 06:02:27 +00:00
2026-10-25 13:42:04 -04:00
2026-10-30 16:08:21 -04:00
2026-10-30 15:48:33 -04:00
2026-10-30 15:58:54 -04:00
2026-10-30 15:42:30 -04:00
2026-10-30 15:59:09 -04:00
2026-10-30 16:08:19 -04:00
2026-10-30 15:48:46 -04:00
2026-10-30 16:05:36 -04:00
2026-10-30 16:08:21 -04:00
2026-10-28 06:02:27 +00:00