mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 02:56:43 +01:00
fix a NULL pointer dereference in ResizeGamestates
This commit is contained in:
parent
996c7e4d8e
commit
1334fc6b1d
2 changed files with 8 additions and 5 deletions
|
@ -167,11 +167,13 @@ SYMBOL_INTERNAL void ResizeGamestates(struct Game* game) {
|
|||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
al_destroy_bitmap(game->_priv.loading.gamestate->fb);
|
||||
if (game->_priv.params.handlers.compositor) {
|
||||
game->_priv.loading.gamestate->fb = CreateNotPreservedBitmap(game->clip_rect.w, game->clip_rect.h);
|
||||
} else {
|
||||
game->_priv.loading.gamestate->fb = al_create_sub_bitmap(al_get_backbuffer(game->display), game->clip_rect.x, game->clip_rect.y, game->clip_rect.w, game->clip_rect.h);
|
||||
if (game->_priv.loading.gamestate) {
|
||||
al_destroy_bitmap(game->_priv.loading.gamestate->fb);
|
||||
if (game->_priv.params.handlers.compositor) {
|
||||
game->_priv.loading.gamestate->fb = CreateNotPreservedBitmap(game->clip_rect.w, game->clip_rect.h);
|
||||
} else {
|
||||
game->_priv.loading.gamestate->fb = al_create_sub_bitmap(al_get_backbuffer(game->display), game->clip_rect.x, game->clip_rect.y, game->clip_rect.w, game->clip_rect.h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -458,6 +458,7 @@ SYMBOL_EXPORT void PrintConsoleWithContext(struct Game* game, int line, const ch
|
|||
fflush(stdout);
|
||||
#endif
|
||||
}
|
||||
|
||||
game->_priv.console_pos++;
|
||||
if (game->_priv.console_pos >= (sizeof(game->_priv.console) / sizeof(game->_priv.console[0]))) {
|
||||
game->_priv.console_pos = 0;
|
||||
|
|
Loading…
Reference in a new issue