diff --git a/CHANGES b/CHANGES index f398c6d5a..a9db55df4 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ Emulation fixes: - GBA Video: Fix Hblank timing Other fixes: - Core: Ensure ELF regions can be written before trying + - Core: Fix ELF loading regression (fixes mgba.io/i/1669) - Debugger: Don't skip undefined instructions when debugger attached - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) Misc: diff --git a/src/core/core.c b/src/core/core.c index 569a6a983..6688bef51 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -377,7 +377,7 @@ bool mCoreLoadELF(struct mCore* core, struct ELF* elf) { Elf32_Phdr* phdr = ELFProgramHeadersGetPointer(&ph, i); void* block = mCoreGetMemoryBlockMasked(core, phdr->p_paddr, &bsize, mCORE_MEMORY_WRITE | mCORE_MEMORY_WORM); char* bytes = ELFBytes(elf, &esize); - if (block && bsize >= phdr->p_filesz && bsize > phdr->p_offset && esize >= phdr->p_filesz + phdr->p_offset) { + if (block && bsize >= phdr->p_filesz && esize > phdr->p_offset && esize >= phdr->p_filesz + phdr->p_offset) { memcpy(block, &bytes[phdr->p_offset], phdr->p_filesz); } else { return false;