freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 058f3f2 2/3: [bdf, psnames, sfnt] Avoid some memory z


From: Werner Lemberg
Subject: [freetype2] master 058f3f2 2/3: [bdf, psnames, sfnt] Avoid some memory zeroing.
Date: Mon, 13 Sep 2021 16:38:09 -0400 (EDT)

branch: master
commit 058f3f2d7d137666810612f9753593025e30eeea
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [bdf, psnames, sfnt] Avoid some memory zeroing.
    
    * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro.
    * src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
    * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero.
---
 src/bdf/bdfdrivr.c     | 2 +-
 src/psnames/psmodule.c | 1 -
 src/sfnt/sfobjs.c      | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index e3c1203..5c7b1f5 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -606,7 +606,7 @@ THE SOFTWARE.
         unsigned long  n;
 
 
-        if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )
+        if ( FT_QNEW_ARRAY( face->en_table, font->glyphs_size ) )
           goto Exit;
 
         face->default_glyph = 0;
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index fff9c42..9fe7d7c 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -325,7 +325,6 @@
 
     /* we first allocate the table */
     table->num_maps = 0;
-    table->maps     = NULL;
 
     if ( !FT_QNEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
     {
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index cf73071..8ca67e3 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1209,7 +1209,7 @@
           /* of `FT_Face', we map `available_sizes' indices to strike    */
           /* indices                                                     */
           if ( FT_NEW_ARRAY( root->available_sizes, count ) ||
-               FT_NEW_ARRAY( sbit_strike_map, count ) )
+               FT_QNEW_ARRAY( sbit_strike_map, count ) )
             goto Exit;
 
           bsize_idx = 0;



reply via email to

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