Fix sema and event flag refer to check size.

If it's zero, write nothing, just like the others.
This commit is contained in:
Unknown W. Brackets 2013-05-18 13:46:50 -07:00
parent f649364b2d
commit ac9e936ba8
2 changed files with 14 additions and 3 deletions

View file

@ -328,7 +328,12 @@ int sceKernelReferSemaStatus(SceUID id, u32 infoPtr)
if (s)
{
DEBUG_LOG(HLE, "sceKernelReferSemaStatus(%i, %08x)", id, infoPtr);
Memory::WriteStruct(infoPtr, &s->ns);
if (!Memory::IsValidAddress(infoPtr))
return -1;
if (Memory::Read_U32(infoPtr) != 0)
Memory::WriteStruct(infoPtr, &s->ns);
return 0;
}
else