From: Holger Schemel Date: Thu, 1 Oct 2020 19:04:15 +0000 (+0200) Subject: fixed potential crash bug when loading custom artwork X-Git-Tag: 4.2.0.3~14 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0d46e11e1cb45a68bb9a7031777dc895961975b2;p=rocksndiamonds.git fixed potential crash bug when loading custom artwork This patch fixes a memory corruption bug that potentially leads to program crashes when loading custom artwork (or level sets with custom artwork) by accessing a potentially invalid bitmap pointer (used for the global border bitmap). --- diff --git a/src/tools.c b/src/tools.c index a4199a14..a041e185 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1337,6 +1337,9 @@ static void RedrawGlobalBorderIfNeeded(void) #if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED if (CheckIfGlobalBorderRedrawIsNeeded()) +#else + // determine and store new global border bitmap for current game status + global_border_bitmap = getGlobalBorderBitmapFromStatus(game_status); #endif { // redraw global screen border (or clear, if defined to be empty)