From 1b291b5c744ce17911d4f0af923b6f230192f6dd Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 22 Jul 2014 17:49:01 +1000 Subject: Make a little safer when there is text that is invalid in the encoding. --- gtk/PlatGTK.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 88edfdec5..ac90dee2a 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1088,6 +1088,10 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION } clusterStart = clusterEnd; } + while (i < lenPositions) { + // If something failed, fill in rest of the positions + positions[i++] = clusterStart; + } PLATFORM_ASSERT(i == lenPositions); } } -- cgit v1.2.3