[PATCH 5/5] usp10: Use heap_calloc() in ScriptShape().
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- dlls/usp10/usp10.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 411d19f..983eb83 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3333,10 +3333,10 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, if (!psva || !pcGlyphs) return E_INVALIDARG; if (cChars > cMaxGlyphs) return E_OUTOFMEMORY; - charProps = heap_alloc_zero(sizeof(SCRIPT_CHARPROP)*cChars); - if (!charProps) return E_OUTOFMEMORY; - glyphProps = heap_alloc_zero(sizeof(SCRIPT_GLYPHPROP)*cMaxGlyphs); - if (!glyphProps) + if (!(charProps = heap_calloc(cChars, sizeof(*charProps)))) + return E_OUTOFMEMORY; + + if (!(glyphProps = heap_calloc(cMaxGlyphs, sizeof(*glyphProps)))) { heap_free(charProps); return E_OUTOFMEMORY; -- 2.1.4
Signed-off-by: Aric Stewart <aric(a)codeweavers.com> On 3/6/18 12:38 AM, Henri Verbeet wrote:
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- dlls/usp10/usp10.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 411d19f..983eb83 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3333,10 +3333,10 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, if (!psva || !pcGlyphs) return E_INVALIDARG; if (cChars > cMaxGlyphs) return E_OUTOFMEMORY;
- charProps = heap_alloc_zero(sizeof(SCRIPT_CHARPROP)*cChars); - if (!charProps) return E_OUTOFMEMORY; - glyphProps = heap_alloc_zero(sizeof(SCRIPT_GLYPHPROP)*cMaxGlyphs); - if (!glyphProps) + if (!(charProps = heap_calloc(cChars, sizeof(*charProps)))) + return E_OUTOFMEMORY; + + if (!(glyphProps = heap_calloc(cMaxGlyphs, sizeof(*glyphProps)))) { heap_free(charProps); return E_OUTOFMEMORY;
participants (2)
-
Aric Stewart -
Henri Verbeet