mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-08 19:42:12 +00:00
From the review of the Ogg demuxer (storytold/craft-libs#440): - The damage scan charges the positions it examines, not a whole 1 MiB read, reads 64 KiB at a time, and says when the 64 MiB budget runs out. A file with many damaged pages lost its tail without a warning. - A page whose lacing claims more bytes than the file has left is skipped and the scan resumes, instead of ending the parse. - A gap in a stream's page sequence numbers drops the packet the lost page continued; its two ends were joined into one corrupted packet. - A beginning-of-stream page for a serial already seen starts a new stream, so a chained file whose links reuse a serial no longer hands the second link's headers to the decoder as audio. - The packets kept from a file are capped by its size (as Matroska caps frames), so zero lacing values cannot make the packet lists many times the file. FLAC metadata under an unstated header count must be a block of the length its header states, and at most 1024 are kept. - A packet over 4 GiB is dropped instead of overflowing its size. - OpusTiming saturates, so hostile granule positions cannot overflow, and a clip whose only audio page is also the last is trimmed at the end (RFC 7845 §4.5) instead of at the start. - Speex streams read extra_headers (offset 68) for their header count. codec_params gives Theora its Xiph-laced headers and Speex its header, rate and channels; the FLAC extradata flags exactly the last block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>