[PATCH 5/5] usp10: Use heap_calloc() in ScriptShapeOpenType().
Aric Stewart
aric at codeweavers.com
Thu Mar 8 06:56:16 CST 2018
Signed-off-by: Aric Stewart <aric at codeweavers.com>
On 3/7/18 1:26 AM, Henri Verbeet wrote:
> Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
> ---
> 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-devel
mailing list