diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 9a41614cd..6a77aab3f 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2548,7 +2548,7 @@ void SurfaceD2D::MeasureWidthsUTF8(const Font *font_, std::string_view text, XYP ui++; PLATFORM_ASSERT(ui < ti); } - for (unsigned int bytePos=0; (bytePos<byteCount) && (i<text.length()); bytePos++) { + for (unsigned int bytePos=0; (bytePos<byteCount) && (i<text.length()) && (ui < tbuf.tlen); bytePos++) { positions[i++] = poses.buffer[ui]; } } |