From f2ab887644f627ced3d91f589f7617cc0d647c27 Mon Sep 17 00:00:00 2001 From: "ALi.w" Date: Thu, 17 Oct 2024 21:09:11 +0330 Subject: [PATCH] Fix getDimension throwing error if there is \r at end of line (#15299) --- src/irrlicht_changes/CGUITTFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/irrlicht_changes/CGUITTFont.cpp b/src/irrlicht_changes/CGUITTFont.cpp index 022ab46b0..bc920d5b3 100644 --- a/src/irrlicht_changes/CGUITTFont.cpp +++ b/src/irrlicht_changes/CGUITTFont.cpp @@ -721,7 +721,7 @@ core::dimension2d CGUITTFont::getDimension(const std::u32string& text) cons if (p == '\r') // Mac or Windows line breaks. { lineBreak = true; - if (*(iter + 1) == '\n') + if (iter + 1 != text.end() && *(iter + 1) == '\n') { ++iter; p = *iter;