mirror of https://github.com/mgba-emu/mgba.git
GBA BIOS: Fix HuffUnComp to work when games pass an invalid bit length
This commit is contained in:
parent
cb14f00279
commit
2688642f01
1
CHANGES
1
CHANGES
|
@ -51,6 +51,7 @@ Bugfixes:
|
||||||
- GBA Memory: Filter out top nybble of DMA addresses
|
- GBA Memory: Filter out top nybble of DMA addresses
|
||||||
- Debugger: Fix binary print putting spaces between digits
|
- Debugger: Fix binary print putting spaces between digits
|
||||||
- GBA BIOS: Fix LZ77UnCompVram to use 16-bit loads from decompressed memory
|
- GBA BIOS: Fix LZ77UnCompVram to use 16-bit loads from decompressed memory
|
||||||
|
- GBA BIOS: Fix HuffUnComp to work when games pass an invalid bit length
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Disable sync to video by default
|
- Qt: Disable sync to video by default
|
||||||
- GBA: Exit cleanly on FATAL if the port supports it
|
- GBA: Exit cleanly on FATAL if the port supports it
|
||||||
|
|
|
@ -385,6 +385,10 @@ static void _unHuffman(struct GBA* gba) {
|
||||||
uint32_t header = cpu->memory.load32(cpu, source, 0);
|
uint32_t header = cpu->memory.load32(cpu, source, 0);
|
||||||
int remaining = header >> 8;
|
int remaining = header >> 8;
|
||||||
int bits = header & 0xF;
|
int bits = header & 0xF;
|
||||||
|
if (bits == 0) {
|
||||||
|
GBALog(gba, GBA_LOG_GAME_ERROR, "Invalid Huffman bits");
|
||||||
|
bits = 8;
|
||||||
|
}
|
||||||
if (32 % bits) {
|
if (32 % bits) {
|
||||||
GBALog(gba, GBA_LOG_STUB, "Unimplemented unaligned Huffman");
|
GBALog(gba, GBA_LOG_STUB, "Unimplemented unaligned Huffman");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue