all repos — mgba @ 47d70582c00ed1faa7bb8417ad56bf3fd44dc5fb

mGBA Game Boy Advance Emulator

GBA BIOS: Fix invalid decompression bounds checking
Vicki Pfau vi@endrift.com
Fri, 26 Mar 2021 19:20:28 -0700
commit

47d70582c00ed1faa7bb8417ad56bf3fd44dc5fb

parent

3ce0472963ea747edb1e7233e2fdfe9b1d8db4b8

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

jump to
M CHANGESCHANGES

@@ -40,6 +40,7 @@ - GBA BIOS: Implement dummy sound driver calls

- GBA BIOS: Improve HLE BIOS timing - GBA BIOS: Fix reloading video registers after reset (fixes mgba.io/i/1808) - GBA BIOS: Make HLE BIOS calls interruptable (fixes mgba.io/i/1711 and mgba.io/i/1823) + - GBA BIOS: Fix invalid decompression bounds checking - GBA DMA: Linger last DMA on bus (fixes mgba.io/i/301 and mgba.io/i/1320) - GBA DMA: Fix ordering and timing of overlapping DMAs - GBA I/O: Green swap register should be readable
M src/gba/bios.csrc/gba/bios.c

@@ -525,7 +525,7 @@ }

break; case GBA_SWI_LZ77_UNCOMP_WRAM: case GBA_SWI_LZ77_UNCOMP_VRAM: - if (cpu->gprs[0] < BASE_WORKING_RAM) { + if (!(cpu->gprs[0] & 0x0E000000)) { mLOG(GBA_BIOS, GAME_ERROR, "Bad LZ77 source"); break; }

@@ -541,7 +541,7 @@ break;

} break; case GBA_SWI_HUFFMAN_UNCOMP: - if (cpu->gprs[0] < BASE_WORKING_RAM) { + if (!(cpu->gprs[0] & 0x0E000000)) { mLOG(GBA_BIOS, GAME_ERROR, "Bad Huffman source"); break; }

@@ -558,7 +558,7 @@ }

break; case GBA_SWI_RL_UNCOMP_WRAM: case GBA_SWI_RL_UNCOMP_VRAM: - if (cpu->gprs[0] < BASE_WORKING_RAM) { + if (!(cpu->gprs[0] & 0x0E000000)) { mLOG(GBA_BIOS, GAME_ERROR, "Bad RL source"); break; }

@@ -576,7 +576,7 @@ break;

case GBA_SWI_DIFF_8BIT_UNFILTER_WRAM: case GBA_SWI_DIFF_8BIT_UNFILTER_VRAM: case GBA_SWI_DIFF_16BIT_UNFILTER: - if (cpu->gprs[0] < BASE_WORKING_RAM) { + if (!(cpu->gprs[0] & 0x0E000000)) { mLOG(GBA_BIOS, GAME_ERROR, "Bad UnFilter source"); break; }