dwrite/layout: Fix invalid index access to cluster array.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45543
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 571ffaf380)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Nikolay Sivov 2019-04-15 18:22:46 +03:00 committed by Michael Stefaniuc
parent b9333b02f6
commit f757ea635c
1 changed files with 3 additions and 0 deletions

View File

@ -1853,6 +1853,9 @@ static void layout_add_line(struct dwrite_textlayout *layout, UINT32 first_clust
metrics.trailingWhitespaceLength += cluster->length;
trailingspacewidth += cluster->width;
if (index == 0)
break;
}
/* Line metrics length includes trailing whitespace length too */