mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-18 18:37:46 +02:00
A game can notify more data than the file actually had - audio/mp3/stream asks for 3360 bytes and notifies all of them even when the read came up short - so the tail of the buffer holds stale bytes from the previous half. We happily decoded those, six frames past the end of the stream, because the end flag only suppressed the zero fill and never stopped the decoder. Check it before decoding too. The post-decode check stays where it was: the hardware rewinds in the same call that decodes the last frame, so the sum reads back as zero right after it, which is what audio/mp3/getsumdecoded records. Moving the whole thing up front breaks that test. Fixes audio/mp3/stream, added to tests_good - it walks 27 refills end to end, so it also covers the half-buffer handout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>