Nikolay Sivov : dwrite: Zero-initialize run analysis object structure.
Alexandre Julliard
julliard at winehq.org
Wed Jan 20 16:58:43 CST 2021
Module: wine
Branch: master
Commit: 5197fd7c91eed7c1ff4309adf904c454f1b19336
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5197fd7c91eed7c1ff4309adf904c454f1b19336
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Jan 20 18:14:33 2021 +0300
dwrite: Zero-initialize run analysis object structure.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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;
More information about the wine-cvs
mailing list