shithub: freetype+ttf2subf

Download patch

ref: 773e31c78397a5471efb7c37d7cd1eca40b46351
parent: d118bf8e35e69454ed046b57ac54dd67d49b87d9
author: Alexei Podtelezhnikov <[email protected]>
date: Tue Jan 18 09:05:46 EST 2022

* 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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -337,10 +337,12 @@
 
     /* 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;