mirror of https://github.com/bsnes-emu/bsnes.git
Hard fail on unexpected SGB blocks
This commit is contained in:
parent
0af4f1fa4d
commit
43fb86320e
|
@ -987,6 +987,7 @@ static int load_bess_save(GB_gameboy_t *gb, virtual_file_t *file, bool is_samebo
|
||||||
break;
|
break;
|
||||||
case BE32('SGB '):
|
case BE32('SGB '):
|
||||||
if (!found_core) goto parse_error;
|
if (!found_core) goto parse_error;
|
||||||
|
if (!gb->sgb) goto parse_error;
|
||||||
if (LE32(block.size) != sizeof(BESS_SGB_t) - sizeof(block)) goto parse_error;
|
if (LE32(block.size) != sizeof(BESS_SGB_t) - sizeof(block)) goto parse_error;
|
||||||
file->read(file, &sgb.header + 1, sizeof(BESS_SGB_t) - sizeof(block));
|
file->read(file, &sgb.header + 1, sizeof(BESS_SGB_t) - sizeof(block));
|
||||||
found_sgb = true;
|
found_sgb = true;
|
||||||
|
|
Loading…
Reference in New Issue