1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Add NULL checks and asserts to graphic options

The game dereferences graphics.screenbuffer without checking it first...
it's unlikely to happen, but the least we can to do be safe is to add a
check and assert here.
This commit is contained in:
Misa 2021-04-22 16:18:06 -07:00 committed by Ethan Lee
parent 0fc17ec277
commit 960bd4a519
2 changed files with 12 additions and 0 deletions

View file

@ -445,6 +445,12 @@ static void menuactionpress(void)
map.nexttowercolour();
break;
case Menu::graphicoptions:
if (graphics.screenbuffer == NULL)
{
SDL_assert(0 && "Screenbuffer is NULL!");
break;
}
switch (game.currentmenuoption)
{
case 0:

View file

@ -251,6 +251,12 @@ static void menurender(void)
}
break;
case Menu::graphicoptions:
if (graphics.screenbuffer == NULL)
{
SDL_assert(0 && "Screenbuffer is NULL!");
break;
}
switch (game.currentmenuoption)
{
case 0: