mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 03:14:34 +01:00
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
deb9693f6a
commit
7f70918def
1 file changed
+4
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user