From 7f70918def39f14dca1d90469e5abfd9dafce4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 21 Oct 2026 07:52:21 +0200 Subject: [PATCH] AuCtx: Accept a savestate with an MP3 handle reserved without parameters sceMp3ReserveMp3Handle(0) gives a context with no buffers, which the PCM buffer size check added to AuCtx::DoState rejected, failing the load partway through. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/HW/SimpleAudioDec.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/HW/SimpleAudioDec.cpp b/Core/HW/SimpleAudioDec.cpp index 178de4ec73..95022b2a55 100644 --- a/Core/HW/SimpleAudioDec.cpp +++ b/Core/HW/SimpleAudioDec.cpp @@ -696,9 +696,11 @@ void AuCtx::DoState(PointerWrap &p) { Do(p, dummy); Do(p, FrameNum); - // The decoder writes a whole frame into each half. The game side requires at least this much. + // The decoder writes a whole frame into each half. The game side requires at least this much, + // except for an MP3 handle reserved without parameters, which has no buffers at all. const u32 minPCMBufSize = audioType == PSP_CODEC_AAC ? 8192 : 9216; - if (p.mode == p.MODE_READ && PCMBufSize < minPCMBufSize) { + const bool noBuffers = PCMBuf == 0 && PCMBufSize == 0; + if (p.mode == p.MODE_READ && PCMBufSize < minPCMBufSize && !noBuffers) { ERROR_LOG(Log::SaveState, "AuCtx: PCM buffer of %d bytes in savestate is too small", PCMBufSize); p.SetError(p.ERROR_FAILURE); return;