mirror of
https://github.com/wiiu-env/CustomRPXLoader.git
synced 2024-11-28 12:44:15 +01:00
Use a properly aligned buffer for reading files
This commit is contained in:
parent
9bd3108fad
commit
187bfdac65
@ -23,7 +23,7 @@ int32_t LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size)
|
|||||||
uint32_t filesize = lseek(iFd, 0, SEEK_END);
|
uint32_t filesize = lseek(iFd, 0, SEEK_END);
|
||||||
lseek(iFd, 0, SEEK_SET);
|
lseek(iFd, 0, SEEK_SET);
|
||||||
|
|
||||||
auto *buffer = (uint8_t *) malloc(ROUNDUP(filesize, 0x40));
|
auto *buffer = (uint8_t *) memalign(0x40, ROUNDUP(filesize, 0x40));
|
||||||
if (buffer == nullptr) {
|
if (buffer == nullptr) {
|
||||||
close(iFd);
|
close(iFd);
|
||||||
return -2;
|
return -2;
|
||||||
|
Loading…
Reference in New Issue
Block a user