[PATCH 5/5] usp10: Use heap_calloc() in ScriptShape().
Aric Stewart
aric at codeweavers.com
Tue Mar 6 07:21:53 CST 2018
Signed-off-by: Aric Stewart <aric at codeweavers.com>
On 3/6/18 12:38 AM, Henri Verbeet wrote:
> Signed-off-by: Henri Verbeet <hverbeet at 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;
>
More information about the wine-devel
mailing list