[PATCH 1/2] dwrite: Fix invalid cluster metrics array index access

Nikolay Sivov nsivov at codeweavers.com
Wed Jan 27 05:52:15 CST 2016


Signed-off-by: Nikolay Sivov <nsivov at 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 0300166..f06f18c 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -3264,7 +3264,7 @@ static HRESULT WINAPI dwritetextlayout_DetermineMinWidth(IDWriteTextLayout2 *ifa
 
         /* Ignore trailing whitespace clusters, in case of single space range will
            be reduced to empty range, or [start,start+1). */
-        while ((end - 1) >= start && This->clustermetrics[end-1].isWhitespace)
+        while (end && (end - 1) >= start && This->clustermetrics[end-1].isWhitespace)
             end--;
 
         /* check if cluster range exceeds last minimal width */
-- 
2.7.0.rc3




More information about the wine-patches mailing list