[PATCH] dwrite: Zero-initialize run analysis object structure.

Nikolay Sivov nsivov at codeweavers.com
Wed Jan 20 09:14:33 CST 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/font.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index c10234e09fc..74e6b929ecd 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -5931,7 +5931,7 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
     if ((UINT32)desc->measuring_mode > DWRITE_MEASURING_MODE_GDI_NATURAL)
         return E_INVALIDARG;
 
-    analysis = heap_alloc(sizeof(*analysis));
+    analysis = heap_alloc_zero(sizeof(*analysis));
     if (!analysis)
         return E_OUTOFMEMORY;
 
@@ -5945,10 +5945,6 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
     else
         analysis->texture_type = DWRITE_TEXTURE_CLEARTYPE_3x1;
 
-    analysis->flags = 0;
-    analysis->bitmap = NULL;
-    analysis->max_glyph_bitmap_size = 0;
-    SetRectEmpty(&analysis->bounds);
     analysis->run = *desc->run;
     IDWriteFontFace_AddRef(analysis->run.fontFace);
     analysis->glyphs = heap_calloc(desc->run->glyphCount, sizeof(*analysis->glyphs));
@@ -5970,12 +5966,8 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
         analysis->m = *desc->transform;
         analysis->flags |= RUNANALYSIS_USE_TRANSFORM;
     }
-    else
-        memset(&analysis->m, 0, sizeof(analysis->m));
 
     analysis->run.glyphIndices = analysis->glyphs;
-    analysis->run.glyphAdvances = NULL;
-    analysis->run.glyphOffsets = NULL;
 
     rtl_factor = desc->run->bidiLevel & 1 ? -1.0f : 1.0f;
 
-- 
2.29.2




More information about the wine-devel mailing list