mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-05 11:29:41 +00:00
Align memory allocation
This commit is contained in:
parent
4132ea5993
commit
f4ba7af2a5
@ -19,13 +19,15 @@ char* load_image(unsigned long offset, unsigned long size)
|
|||||||
if (size == 0)
|
if (size == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
image = malloc(size);
|
image = malloc(size + 4);
|
||||||
if (image == 0)
|
if (image == 0)
|
||||||
{
|
{
|
||||||
free(image);
|
free(image);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image = (char*)(((unsigned long)image + 3) & 0xFFFFFFFC);
|
||||||
|
|
||||||
memset(¶m_block, 0, sizeof(param_block));
|
memset(¶m_block, 0, sizeof(param_block));
|
||||||
|
|
||||||
param_block.ioBuffer = (unsigned long)image;
|
param_block.ioBuffer = (unsigned long)image;
|
||||||
|
Loading…
Reference in New Issue
Block a user