From: Holger Schemel Date: Mon, 14 Oct 2024 21:26:21 +0000 (+0200) Subject: fixed checking valid range for drawing wrapped text X-Git-Tag: 4.4.0.0-test-4~130 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fc9f2ed4c82185094513da8fe9d084ea6b35906c;p=rocksndiamonds.git fixed checking valid range for drawing wrapped text --- diff --git a/src/libgame/text.c b/src/libgame/text.c index 0f1c05f9..d946f772 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -765,7 +765,7 @@ int DrawWrappedText(int x, int y, struct WrappedTextInfo *wrapped_text, int star if (wrapped_text == NULL) return 0; - if (start_pos >= wrapped_text->num_lines) + if (start_pos < 0 || start_pos >= wrapped_text->num_lines) return 0; wrapped_text->line_visible_first = start_pos;