From 8d08ff3745536da0fd6107f97325e0fd33528227 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 7 Mar 2018 10:56:44 +0330 Subject: [PATCH] usp10: Use heap_calloc() in ScriptShapeOpenType(). Signed-off-by: Henri Verbeet Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/usp10/usp10.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 983eb839a68..52c70448ce9 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3188,8 +3188,9 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, WCHAR *rChars; if ((hr = SHAPE_CheckFontForRequiredFeatures(hdc, (ScriptCache *)*psc, psa)) != S_OK) return hr; - rChars = heap_alloc(sizeof(WCHAR) * cChars); - if (!rChars) return E_OUTOFMEMORY; + if (!(rChars = heap_calloc(cChars, sizeof(*rChars)))) + return E_OUTOFMEMORY; + for (i = 0, g = 0, cluster = 0; i < cChars; i++) { int idx = i;