Henri Verbeet : usp10: Use heap_calloc() in ScriptTextOut().
Alexandre Julliard
julliard at winehq.org
Fri Mar 2 12:16:45 CST 2018
Module: wine
Branch: master
Commit: 8889c86297cc9230f2597172093b242f195c3a79
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8889c86297cc9230f2597172093b242f195c3a79
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Mar 2 12:28:49 2018 +0330
usp10: Use heap_calloc() in ScriptTextOut().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/usp10/usp10.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index f2264a2..103b345 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -3609,14 +3609,13 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN
if (!psa->fNoGlyphIndex) /* Have Glyphs? */
fuOptions |= ETO_GLYPH_INDEX; /* Say don't do translation to glyph */
- lpDx = heap_alloc(cGlyphs * sizeof(INT) * 2);
- if (!lpDx) return E_OUTOFMEMORY;
+ if (!(lpDx = heap_calloc(cGlyphs, 2 * sizeof(*lpDx))))
+ return E_OUTOFMEMORY;
fuOptions |= ETO_PDY;
if (psa->fRTL && psa->fLogicalOrder)
{
- reordered_glyphs = heap_alloc( cGlyphs * sizeof(WORD) );
- if (!reordered_glyphs)
+ if (!(reordered_glyphs = heap_calloc(cGlyphs, sizeof(*reordered_glyphs))))
{
heap_free( lpDx );
return E_OUTOFMEMORY;
More information about the wine-cvs
mailing list