Don't even try to allocate a 0 sized buffer.

This commit is contained in:
Unknown W. Brackets committed 2013-08-18 18:38:07 -07:00
1 parent fa73875c98
commit 88b333bd16
1 file changed
+10 -6
+10 -6
View File
@@ -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();