mirror of https://github.com/mgba-emu/mgba.git
GBA BIOS: Add warning for LZ77 error causing BIOS to hang (closes #879)
This commit is contained in:
parent
388ed07074
commit
e104b46564
|
@ -529,7 +529,11 @@ static void _unLz77(struct GBA* gba, int width) {
|
||||||
source += 2;
|
source += 2;
|
||||||
disp = dest - (block & 0x0FFF) - 1;
|
disp = dest - (block & 0x0FFF) - 1;
|
||||||
bytes = (block >> 12) + 3;
|
bytes = (block >> 12) + 3;
|
||||||
while (bytes-- && remaining) {
|
while (bytes--) {
|
||||||
|
if (!remaining) {
|
||||||
|
mLOG(GBA_BIOS, GAME_ERROR, "Improperly compressed LZ77 data. Real BIOS would hang.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
--remaining;
|
--remaining;
|
||||||
if (width == 2) {
|
if (width == 2) {
|
||||||
byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0);
|
byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0);
|
||||||
|
|
Loading…
Reference in New Issue