Fix getDimension throwing error if there is \r at end of line (#15299)

This commit is contained in:
ALi.w
2024-10-17 21:09:11 +03:30
committed by GitHub
parent 4975afb5ff
commit f2ab887644

View File

@ -721,7 +721,7 @@ core::dimension2d<u32> 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;