all repos — mgba @ 92c1087adffd1ad5b6e27f355796d8908afbaa7e

mGBA Game Boy Advance Emulator

DS: Fix freeing memory for partial BIOS on load failure
Vicki Pfau vi@endrift.com
Tue, 21 Jul 2020 19:17:38 -0700
commit

92c1087adffd1ad5b6e27f355796d8908afbaa7e

parent

1c0aa6c358d6163563a192ce375869586646cbd0

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

jump to
M CHANGESCHANGES

@@ -16,6 +16,7 @@ - GBA Video: Fix mode 2 out-of-bounds VRAM crash

- GBA Video: Fix regression adjusting brightness of backdrop - DS GX: Properly reject invalid commands - DS: Fix leaking BIOS and firmware filehandles + - DS: Fix freeing memory for partial BIOS on load failure Misc: - DS GX: Clean up and unify texture mapping - DS Core: Add symbol loading
M src/ds/ds.csrc/ds/ds.c

@@ -597,7 +597,11 @@ ds->memory.bios9 = data;

mLOG(DS, INFO, "Official DS ARM9 BIOS detected"); } else { mLOG(DS, WARN, "BIOS checksum incorrect"); - vf->unmap(vf, data, size); + if (size == 0x1000) { + free(data); + } else { + vf->unmap(vf, data, size); + } return false; } return true;