freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 773e31c78: * src/autofit/afglobal.c (af_face_globals_


From: Werner Lemberg
Subject: [freetype2] master 773e31c78: * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.
Date: Tue, 18 Jan 2022 14:11:23 -0500 (EST)

branch: master
commit 773e31c78397a5471efb7c37d7cd1eca40b46351
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.
    
    Everything in AF_FaceGlobals is initialized except metrics.  Those
    are zeroed here and initialized on demand later.
---
 src/autofit/afglobal.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index 4092de6ba..87a3fbfb0 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -337,11 +337,13 @@
 
     /* we allocate an AF_FaceGlobals structure together */
     /* with the glyph_styles array                      */
-    if ( FT_ALLOC( globals,
-                   sizeof ( *globals ) +
-                     (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
+    if ( FT_QALLOC( globals,
+                    sizeof ( *globals ) +
+                      (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
       goto Exit;
 
+    FT_ZERO( &globals->metrics );
+
     globals->face                      = face;
     globals->glyph_count               = face->num_glyphs;
     /* right after the globals structure come the glyph styles */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]