aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--win32/PlatWin.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index f9a9fa1c5..36479e0f2 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -787,7 +787,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi
} else if (uch >= (0x80)) {
lenChar = 2;
}
- for (unsigned int bytePos=0; bytePos<lenChar; bytePos++) {
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
positions[i++] = poses[ui];
}
ui++;