GBA BIOS: Add warning for LZ77 error causing BIOS to hang (closes #879)

This commit is contained in:
Vicki Pfau 2017-11-16 09:22:15 -08:00
parent 388ed07074
commit e104b46564
1 changed files with 5 additions and 1 deletions

View File

@ -529,7 +529,11 @@ static void _unLz77(struct GBA* gba, int width) {
source += 2;
disp = dest - (block & 0x0FFF) - 1;
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;
if (width == 2) {
byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0);