From: Holger Schemel Date: Sun, 15 Jun 2025 21:41:34 +0000 (+0200) Subject: fixed crash bugs (caused by dereferencing null pointer) X-Git-Tag: 4.4.0.6~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=253b62b7cf67354ca22fb47b4f0ef90f3c07c5bc;p=rocksndiamonds.git fixed crash bugs (caused by dereferencing null pointer) --- diff --git a/src/screens.c b/src/screens.c index 4ac66a28..0bb36843 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4678,7 +4678,7 @@ void HandleInfoScreen_Generic(int mx, int my, int dx, int dy, int button) else if (button == MB_MENU_CONTINUE) { // if space key was pressed, show next page of info screen, if available - if (wrapped_text->line_visible_last < wrapped_text->num_lines - 1) + if (wrapped_text != NULL && wrapped_text->line_visible_last < wrapped_text->num_lines - 1) HandleInfoScreen(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK); else HandleInfoScreen(0, 0, 0, 0, MB_MENU_CHOICE); @@ -4710,8 +4710,9 @@ void HandleInfoScreen_Generic(int mx, int my, int dx, int dy, int button) FadeIn(REDRAW_FIELD); } } - else if ((dy < 0 && wrapped_text->line_visible_first > 0) || - (dy > 0 && wrapped_text->line_visible_last < wrapped_text->num_lines - 1)) + else if (wrapped_text != NULL && + ((dy < 0 && wrapped_text->line_visible_first > 0) || + (dy > 0 && wrapped_text->line_visible_last < wrapped_text->num_lines - 1))) { if (ABS(dy) == SCROLL_PAGE) {