mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
The frame decoder reads from one flat buffer and cannot refill it, but request_buffer() only guarantees 32KiB of contiguous data (the buffering guard area). Frames that can be larger than that, such as high resolution or poorly compressible streams (FLAC decoder testbench file 31), could be handed to the decoder truncated, which read past the end of the data and lost sync. When a request returns less than the largest frame the stream can contain (STREAMINFO max framesize, or a bound from block size, channels and bit depth) and it is not the end of the file, copy the frame into a private static buffer and decode from that. Streams whose frames always fit never touch the buffer and pay one comparison per frame. The buffer is 64KiB, or sized for the 4608 sample blocks of memory limited targets, and is left out entirely when MEMORYSIZE is 2MB or less. Also fail with a codec error, instead of advancing past the data, if a decoded frame consumed more bytes than were provided. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Change-Id: Ib4cf85ad513f8e096f73d13b4374d072e1745cb2 |
||
|---|---|---|
| .. | ||
| arm_support | ||
| fixedpoint | ||
| libsetjmp | ||
| microtar | ||
| mipsunwinder | ||
| rbcodec | ||
| skin_parser | ||
| tlsf | ||
| unwarminder | ||
| utf8proc | ||