Return an invalid size error even for VAG = 0.

This commit is contained in:
Unknown W. Brackets 2013-05-27 12:19:19 -07:00
parent aeb2b23735
commit 91bdc0617e

View File

@ -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;