mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix send of 0 bytes, more error handling.
This commit is contained in:
parent
29067edf52
commit
769bac3acf
1 changed files with 13 additions and 1 deletions
|
@ -435,6 +435,18 @@ int __KernelSendMsgPipe(MsgPipe *m, u32 sendBufAddr, u32 sendSize, int waitMode,
|
|||
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
|
||||
}
|
||||
|
||||
if (sendSize != 0 && !Memory::IsValidAddress(sendBufAddr))
|
||||
{
|
||||
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d): bad buffer address %08x (should crash?)", uid, sendBufAddr);
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
|
||||
}
|
||||
|
||||
if (waitMode != SCE_KERNEL_MPW_ASAP && waitMode != SCE_KERNEL_MPW_FULL)
|
||||
{
|
||||
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d): invalid wait mode", uid, waitMode);
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_MODE;
|
||||
}
|
||||
|
||||
// If the buffer size is 0, nothing is buffered and all operations wait.
|
||||
if (m->nmp.bufSize == 0)
|
||||
{
|
||||
|
@ -506,7 +518,7 @@ int __KernelSendMsgPipe(MsgPipe *m, u32 sendBufAddr, u32 sendSize, int waitMode,
|
|||
if (m->CheckReceiveThreads())
|
||||
hleReSchedule(cbEnabled, "msgpipe data sent");
|
||||
}
|
||||
else
|
||||
else if (sendSize != 0)
|
||||
{
|
||||
if (poll)
|
||||
return SCE_KERNEL_ERROR_MPP_FULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue