Skip to content

Commit c924a2e

Browse files
authored
Merge pull request xbmc#27527 from CastagnaIT/fix_text_wrap
[GUITextLayout] Fix vector iterator incremented past end
2 parents 82844bb + 15ecfd6 commit c924a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xbmc/guilib/GUITextLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void CGUITextLayout::WrapText(const vecText &text, float maxWidth)
657657
// current line is empty and word is too long: split by character using a safe linear scan.
658658
// Do not assume monotonic width because shaping/kerning can make width shrink or grow non-linearly.
659659
size_t bestCount = 0;
660-
for (auto it = std::next(current); it <= wordEnd; ++it)
660+
for (auto it = std::next(current); it < wordEnd; ++it)
661661
{
662662
if (m_font->GetTextWidth({current, it}) <= maxWidth)
663663
bestCount = std::distance(current, it);

0 commit comments

Comments
 (0)