Henri Verbeet : usp10: Use heap_calloc() in ScriptShapeOpenType().

Alexandre Julliard julliard at winehq.org
Thu Mar 8 15:18:42 CST 2018


Module: wine
Branch: master
Commit: 8d08ff3745536da0fd6107f97325e0fd33528227
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8d08ff3745536da0fd6107f97325e0fd33528227

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Mar  7 11:14:44 2018 +0330

usp10: Use heap_calloc() in ScriptShapeOpenType().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 983eb83..52c7044 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;




More information about the wine-cvs mailing list