From 91bdc0617e50223191f7fd3d90d0cdf46cdec0d6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 27 May 2013 12:19:19 -0700 Subject: [PATCH] Return an invalid size error even for VAG = 0. --- Core/HLE/sceSas.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index bb0387fd2..94e7d1112 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -124,16 +124,16 @@ u32 sceSasSetVoice(u32 core, int voiceNum, u32 vagAddr, int size, int loop) { return ERROR_SAS_INVALID_VOICE; } - if (!Memory::IsValidAddress(vagAddr)) { - ERROR_LOG(HLE, "Ignoring invalid VAG audio address %08x", vagAddr); - return 0; - } - if (size <= 0 || (size & 0xF) != 0) { WARN_LOG(HLE, "%s: invalid size %d", __FUNCTION__, size); return ERROR_SAS_INVALID_SIZE; } + if (!Memory::IsValidAddress(vagAddr)) { + ERROR_LOG(HLE, "Ignoring invalid VAG audio address %08x", vagAddr); + return 0; + } + //Real VAG header is 0x30 bytes behind the vagAddr SasVoice &v = sas->voices[voiceNum]; u32 prevVagAddr = v.vagAddr;