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:
parent
0fc17ec277
commit
960bd4a519
2 changed files with 12 additions and 0 deletions
|
@ -445,6 +445,12 @@ static void menuactionpress(void)
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
case Menu::graphicoptions:
|
case Menu::graphicoptions:
|
||||||
|
if (graphics.screenbuffer == NULL)
|
||||||
|
{
|
||||||
|
SDL_assert(0 && "Screenbuffer is NULL!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (game.currentmenuoption)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -251,6 +251,12 @@ static void menurender(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Menu::graphicoptions:
|
case Menu::graphicoptions:
|
||||||
|
if (graphics.screenbuffer == NULL)
|
||||||
|
{
|
||||||
|
SDL_assert(0 && "Screenbuffer is NULL!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (game.currentmenuoption)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
Loading…
Reference in a new issue