all repos — mgba @ 6ab819327919874595767598ccd10f1d34a36913

mGBA Game Boy Advance Emulator

Core: Fix reported ROM size when a fixed buffer size is used
Vicki Pfau vi@endrift.com
Mon, 10 Aug 2020 00:09:02 -0700
commit

6ab819327919874595767598ccd10f1d34a36913

parent

5fd48c25dccc5b2b9acdf9436f4f972daaa914f8

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

jump to
M CHANGESCHANGES

@@ -30,6 +30,7 @@ - 3DS: Redo video sync to be more precise

- 3DS: Fix crash with libctru 2.0 when exiting - All: Improve export headers (fixes mgba.io/i/1738) - Core: Ensure ELF regions can be written before trying + - Core: Fix reported ROM size when a fixed buffer size is used - Debugger: Don't skip undefined instructions when debugger attached - FFmpeg: Fix some small memory leaks - FFmpeg: Fix encoding of time base
M src/core/core.csrc/core/core.c

@@ -145,7 +145,10 @@

#ifdef FIXED_ROM_BUFFER extern uint32_t* romBuffer; extern size_t romBufferSize; - vfm = VFileFromMemory(romBuffer, romBufferSize); + if (size > romBufferSize) { + size = romBufferSize; + } + vfm = VFileFromMemory(romBuffer, size); #else vfm = VFileMemChunk(NULL, size); #endif