From fc9f2ed4c82185094513da8fe9d084ea6b35906c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 14 Oct 2024 23:26:21 +0200 Subject: [PATCH] fixed checking valid range for drawing wrapped text --- src/libgame/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1