From 0d46e11e1cb45a68bb9a7031777dc895961975b2 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 1 Oct 2020 21:04:15 +0200 Subject: [PATCH] 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). --- src/tools.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.34.1