[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.
This commit is contained in:
Alexei Podtelezhnikov 2021-04-25 23:40:59 -04:00
parent c2d283143a
commit 270ff52f62
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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.

View File

@ -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,

View File

@ -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 ) )
{