usp10: Use heap_calloc() in ScriptShape().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-03-06 10:08:30 +03:30 committed by Alexandre Julliard
parent 798439ba31
commit 315be161ce
1 changed files with 4 additions and 4 deletions

View File

@ -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;