mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Don't even try to allocate a 0 sized buffer.
This commit is contained in:
1 parent
fa73875c98
commit
88b333bd16
1 file changed
+10
-6
@@ -219,13 +219,17 @@ int sceKernelCreateMsgPipe(const char *name, int partition, u32 attr, u32 size,
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_ATTR;
|
||||
}
|
||||
|
||||
// We ignore the upalign to 256.
|
||||
u32 allocSize = size;
|
||||
u32 memBlockPtr = userMemory.Alloc(allocSize, (attr & SCE_KERNEL_MPA_HIGHMEM) != 0, "MsgPipe");
|
||||
if (memBlockPtr == (u32)-1)
|
||||
u32 memBlockPtr = 0;
|
||||
if (size != 0)
|
||||
{
|
||||
ERROR_LOG(HLE, "%08x=sceKernelCreateEventFlag(%s): Failed to allocate %i bytes for buffer", SCE_KERNEL_ERROR_NO_MEMORY, name, size);
|
||||
return SCE_KERNEL_ERROR_NO_MEMORY;
|
||||
// We ignore the upalign to 256.
|
||||
u32 allocSize = size;
|
||||
memBlockPtr = userMemory.Alloc(allocSize, (attr & SCE_KERNEL_MPA_HIGHMEM) != 0, "MsgPipe");
|
||||
if (memBlockPtr == (u32)-1)
|
||||
{
|
||||
ERROR_LOG(HLE, "%08x=sceKernelCreateEventFlag(%s): Failed to allocate %i bytes for buffer", SCE_KERNEL_ERROR_NO_MEMORY, name, size);
|
||||
return SCE_KERNEL_ERROR_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
MsgPipe *m = new MsgPipe();
|
||||
|
||||
Reference in new issue
Block a user