mirror of
https://github.com/storytold/soundcraft.git
synced 2026-11-01 14:36:50 -06:00
WAV files that aren't plain PCM (A-law, µ-law, ADPCM) go to symphonia, which reads every entry of an INFO list into a buffer of its declared size, bounded only by the list's and file's declared lengths. A file claiming a 4 GB RIFF and a 2 GB title asked for 2 GB before failing. macOS gives that lazily; a 32-bit build or a system that can't commit it aborts. Before symphonia reads such a WAV, its INFO entries are checked against the bytes the file holds, and one that claims more is refused as malformed. Chunks are walked where symphonia reads them, not where their lengths say: A-law, µ-law and ADPCM `fmt` chunks are read by their own extra size, extensible ones by 40 bytes, and a list is padded twice.