summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorPaweł Fertyk <pfertyk@pfertyk.me>2022-11-06 13:02:16 +0100
committerYuri Sizov <yuris@humnom.net>2023-03-13 14:13:36 +0100
commit41f4068a6e81f5f0e94428ddc04330f6a154ee70 (patch)
tree3d92a0126f9b42695287034ef2f37d8a57fbcf3e /scene/gui
parent755a86f5025e9166e3c5b140d0bf5650166f0db1 (diff)
Fix RichTextLabel crash with out of bound exception
Fixes #68242. (cherry picked from commit 44592c8c197b072d5beee3f14c9c6869a94e9671)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 44478d45cc..ec1fbb7e28 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -2375,7 +2375,7 @@ int RichTextLabel::_find_list(Item *p_item, Vector<int> &r_index, Vector<ItemLis
int index = 1;
if (frame != nullptr) {
- for (int i = list->line + 1; i <= prev_item->line; i++) {
+ for (int i = list->line + 1; i <= prev_item->line && i < (int)frame->lines.size(); i++) {
if (_find_list_item(frame->lines[i].from) == list) {
index++;
}