:: commit 07ff25bd46b7c9f0a936d5b9c3898704bcec2cee

Mintsuki <mintsuki@protonmail.com> — 2025-12-24 22:18

parents: 4820efdf2e

fs/file: Fix potential issue with loading very big files on 32-bit systems

diff --git a/common/fs/file.s2.c b/common/fs/file.s2.c
index 4db44f4b..2fecb9f5 100644
--- a/common/fs/file.s2.c
+++ b/common/fs/file.s2.c
@@ -150,7 +150,7 @@ void *freadall_mode(struct file_handle *fd, uint32_t type, bool allow_high_alloc
                 goto low_ret;
             }
             void *pool = ext_mem_alloc(0x100000);
-            for (size_t i = 0; i < fd->size; i += 0x100000) {
+            for (uint64_t i = 0; i < fd->size; i += 0x100000) {
                 size_t count;
                 if (fd->size - i < 0x100000) {
                     count = fd->size - i;
tab: 248 wrap: offon