Skip to content

Commit

Permalink
Use a properly aligned buffer for reading files
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Mar 5, 2022
1 parent 9bd3108 commit 187bfda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int32_t LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_t *size)
uint32_t filesize = lseek(iFd, 0, SEEK_END);
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) {
close(iFd);
return -2;
Expand Down

0 comments on commit 187bfda

Please sign in to comment.