all repos — mgba @ 5f3dc723f613a3057c91751b36871fb237fb79fd

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

5f3dc723f613a3057c91751b36871fb237fb79fd

parent

f1d5e39f88f40b867a57c2e8902b27a0989f6333

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

jump to
M CHANGESCHANGES

@@ -1,3 +1,7 @@

+0.8.2: (Future) +Other fixes: + - Core: Fix ELF loading regression (fixes mgba.io/i/1669) + 0.8.1: (2020-02-16) Emulation fixes: - GB Serialize: Fix timing bug loading channel 4 timing
M src/core/core.csrc/core/core.c

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

Elf32_Phdr* phdr = ELFProgramHeadersGetPointer(&ph, i); void* block = mCoreGetMemoryBlock(core, phdr->p_paddr, &bsize); 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;