Added dwrite-layout-check patchset

This commit is contained in:
Alistair Leslie-Hughes
2018-08-01 09:34:07 +10:00
parent e1fb783018
commit b6649197d6
3 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From 1b821d7a8398741a164800039535aaad396c299e Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Tue, 31 Jul 2018 08:35:01 +0300
Subject: [PATCH] dwrite: Avoid possible out-of-bounds cluster metrics access.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
---
dlls/dwrite/layout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 306c1178d4..903e7e8978 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -2089,7 +2089,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
*/
if (layout->len == 0)
hr = layout_set_dummy_line_metrics(layout, 0);
- else if (layout->clustermetrics[layout->cluster_count - 1].isNewline)
+ else if (layout->cluster_count && layout->clustermetrics[layout->cluster_count - 1].isNewline)
hr = layout_set_dummy_line_metrics(layout, layout->len - 1);
if (FAILED(hr))
return hr;
--
2.18.0

View File

@ -0,0 +1,2 @@
Fixes: [45535] - dwrite Correct out of access