[PATCH 5/5] usp10: Use heap_calloc() in ScriptPlace().

Aric Stewart aric at codeweavers.com
Mon Mar 5 06:45:01 CST 2018


Signed-off-by: Aric Stewart <aric at codeweavers.com>

On 3/5/18 1:36 AM, Henri Verbeet wrote:
> Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
> ---
>   dlls/usp10/usp10.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
> index 103b345..411d19f 100644
> --- a/dlls/usp10/usp10.c
> +++ b/dlls/usp10/usp10.c
> @@ -3501,8 +3501,8 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
>       if (!psva) return E_INVALIDARG;
>       if (!pGoffset) return E_FAIL;
>   
> -    glyphProps = heap_alloc(sizeof(SCRIPT_GLYPHPROP)*cGlyphs);
> -    if (!glyphProps) return E_OUTOFMEMORY;
> +    if (!(glyphProps = heap_calloc(cGlyphs, sizeof(*glyphProps))))
> +        return E_OUTOFMEMORY;
>   
>       for (i = 0; i < cGlyphs; i++)
>           glyphProps[i].sva = psva[i];
> 



More information about the wine-devel mailing list