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>
This commit is contained in:
Nikolay Sivov 2019-04-15 18:22:46 +03:00 committed by Alexandre Julliard
parent 40c74cf336
commit 571ffaf380
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 */