Files
source/ext
95cf0621a0 grow libsmacker audio buffer when a frame exceeds the header max_buffer
The Smacker header declares a max audio chunk size, and libsmacker sized its
output buffer from it — then wrote each frame's audio trusting the frame's
own unpacked size, unchecked. The fan-localized intro videos (Chinese among
others) declare max_buffer=2304 but carry ~97KB audio frames: every decode
was a heap overflow, crashing the intro. The original SMACKW32.DLL played
these files, so treat the per-frame size as truth and grow the buffer,
bounded by a 16MB sanity cap; a chunk beyond that fails the frame as corrupt.
Covers both the raw-PCM and DPCM paths.

Verified with an ASan/UBSan harness over all 19 vanilla and Chinese intro
SMKs: previously all 8 Chinese files faulted, now all decode both passes
clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 21:31:13 -03:00
..
2023-05-08 06:44:35 -03:00
2023-01-14 02:08:39 -03:00
2026-07-23 19:01:37 -03:00