Allocate less in sceKernelLoadModuleByID w/ offset.

Though, this may still be too much?  I wonder if it parses to figure the
size or anything.
This commit is contained in:
Unknown W. Brackets
2015-01-10 08:36:12 -08:00
parent 0ef589165b
commit 1b7ee8c269
+2 -2
View File
@@ -2141,8 +2141,8 @@ static u32 sceKernelLoadModuleByID(u32 id, u32 flags, u32 lmoptionPtr)
std::string error_string;
pspFileSystem.SeekFile(handle, pos, FILEMOVE_BEGIN);
Module *module = 0;
u8 *temp = new u8[size];
pspFileSystem.ReadFile(handle, temp, size);
u8 *temp = new u8[size - pos];
pspFileSystem.ReadFile(handle, temp, size - pos);
u32 magic;
module = __KernelLoadELFFromPtr(temp, 0, lmoption ? lmoption->position == 1 : false, &error_string, &magic, error);
delete [] temp;