From 6541e52f05921db1f796b1da467bd34ae1206d08 Mon Sep 17 00:00:00 2001 From: luigoalma Date: Sat, 7 Mar 2020 22:35:16 +0000 Subject: [PATCH] Reinforcing alignment to buffer size --- arm9/source/filesys/filetype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm9/source/filesys/filetype.c b/arm9/source/filesys/filetype.c index 479ea73..5db4daa 100644 --- a/arm9/source/filesys/filetype.c +++ b/arm9/source/filesys/filetype.c @@ -20,7 +20,7 @@ u64 IdentifyFileType(const char* path) { const u8 png_magic[] = { PNG_MAGIC }; if (!path) return 0; // safety - u8 ALIGN(32) header[0x2B8]; // minimum required size + u8 ALIGN(32) header[0x2C0]; // minimum required size void* data = (void*) header; size_t fsize = FileGetSize(path); char* fname = strrchr(path, '/'); @@ -36,7 +36,7 @@ u64 IdentifyFileType(const char* path) { } else { ext = ""; } - if (FileGetData(path, header, 0x2B8, 0) < min(0x2B8, fsize)) return 0; + if (FileGetData(path, header, 0x2C0, 0) < min(0x2C0, fsize)) return 0; if (!fsize) return 0; if (fsize >= 0x200) {