all repos — mgba @ 7d382e82a6306f378ac0c8e4861504f7e60b386a

mGBA Game Boy Advance Emulator

Core: Fix ELF loading regression (fixes #1669)
Vicki Pfau vi@endrift.com
Sun, 16 Feb 2020 20:52:02 -0800
commit

7d382e82a6306f378ac0c8e4861504f7e60b386a

parent

9c88d4880623cebb3fea297173ee1b471a639095

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -12,6 +12,7 @@ - GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319)

- 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:
M src/core/core.csrc/core/core.c

@@ -377,7 +377,7 @@ size_t bsize, esize;

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;