Commit 270ff52f62ecf6b38744fa5f6b95808dd7dc49d9

Alexei Podtelezhnikov 2021-04-25T23:40:59

[base] Avoid some memory zeroing. * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Use FT_QNEW_ARRAY. * src/base/ftsnames.c (FT_Get_Sfnt_{Name,LangTag}): Ditto.

diff --git a/ChangeLog b/ChangeLog
index 4de256c..0a834af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
+	[base] Avoid some memory zeroing.
+
+	* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Use FT_QNEW_ARRAY.
+	* src/base/ftsnames.c (FT_Get_Sfnt_{Name,LangTag}): Ditto.
+
+2021-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
 	[bdf,pcf] Avoid some memory zeroing.
 
 	* src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties, pcf_load_font):
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index 50203be..386e3de 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -299,7 +299,7 @@
                         j, ref[j].res_id, ref[j].offset ));
         }
 
-        if ( FT_NEW_ARRAY( offsets_internal, *count ) )
+        if ( FT_QNEW_ARRAY( offsets_internal, *count ) )
           goto Exit;
 
         /* XXX: duplicated reference ID,
diff --git a/src/base/ftsnames.c b/src/base/ftsnames.c
index b14c5f9..44dba66 100644
--- a/src/base/ftsnames.c
+++ b/src/base/ftsnames.c
@@ -65,7 +65,7 @@
           FT_Stream  stream = face->stream;
 
 
-          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
+          if ( FT_QNEW_ARRAY ( entry->string, entry->stringLength ) ||
                FT_STREAM_SEEK( entry->stringOffset )                ||
                FT_STREAM_READ( entry->string, entry->stringLength ) )
           {
@@ -121,7 +121,7 @@
           FT_Stream  stream = face->stream;
 
 
-          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
+          if ( FT_QNEW_ARRAY ( entry->string, entry->stringLength ) ||
                FT_STREAM_SEEK( entry->stringOffset )                ||
                FT_STREAM_READ( entry->string, entry->stringLength ) )
           {