From e40682c32de621a0a0989d708e9ba0b1cc209c6d Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Sun, 14 Feb 2021 16:02:01 +0100 Subject: [PATCH] RichTextLabel::add_image Fail if passed image has no area (cherry picked from commit a4afdd4a77f7d169f046416570bf60ab24c79845) --- scene/gui/rich_text_label.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 7cde6bbdc50..dd275e346c8 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1678,6 +1678,8 @@ void RichTextLabel::add_image(const Ref &p_image, const int p_width, co return; ERR_FAIL_COND(p_image.is_null()); + ERR_FAIL_COND(p_image->get_width() == 0); + ERR_FAIL_COND(p_image->get_height() == 0); ItemImage *item = memnew(ItemImage); item->image = p_image;