check banks overflow

This commit is contained in:
BADIM-PC\Vadim 2017-12-15 12:00:33 +03:00
parent f7f30d47dc
commit a2e59da716
1 changed files with 5 additions and 0 deletions

View File

@ -1639,6 +1639,11 @@ static void api_load(tic_cartridge* cart, const u8* buffer, s32 size, bool palet
}
buffer += chunk.size;
// check banks overflow
for(s32 i = 0; i < sizeof bank / sizeof(s32); i++)
if(((s32*)&bank)[i] >= TIC_BANKS)
return;
}
#undef LOAD_CHUNK