From a2e59da7160e55b8d1b59a48d8e826553142286f Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Fri, 15 Dec 2017 12:00:33 +0300 Subject: [PATCH] check banks overflow --- src/tic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tic.c b/src/tic.c index f5f295b..f5214d3 100644 --- a/src/tic.c +++ b/src/tic.c @@ -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