[bdf,pcf] Avoid memory zeroing (contd.). * src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment, _bdf_add_property, bdf_load_font): Tweak allocation macros. * src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
diff --git a/ChangeLog b/ChangeLog
index f6fbaba..122fc56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-25 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [bdf,pcf] Avoid memory zeroing (contd.).
+
+ * src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment,
+ _bdf_add_property, bdf_load_font): Tweak allocation macros.
+ * src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
+
2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/cid/cidload.c (cid_read_subrs): Tweak allocaton macro.
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index af276f4..a27a6fe 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -844,9 +844,9 @@
if ( ft_hash_str_lookup( name, &(font->proptbl) ) )
goto Exit;
- if ( FT_RENEW_ARRAY( font->user_props,
- font->nuser_props,
- font->nuser_props + 1 ) )
+ if ( FT_QRENEW_ARRAY( font->user_props,
+ font->nuser_props,
+ font->nuser_props + 1 ) )
goto Exit;
p = font->user_props + font->nuser_props;
@@ -941,9 +941,9 @@
FT_Error error = FT_Err_Ok;
- if ( FT_RENEW_ARRAY( font->comments,
- font->comments_len,
- font->comments_len + len + 1 ) )
+ if ( FT_QRENEW_ARRAY( font->comments,
+ font->comments_len,
+ font->comments_len + len + 1 ) )
goto Exit;
cp = font->comments + font->comments_len;
@@ -1158,9 +1158,9 @@
/* Allocate another property if this is overflowing. */
if ( font->props_used == font->props_size )
{
- if ( FT_RENEW_ARRAY( font->props,
- font->props_size,
- font->props_size + 1 ) )
+ if ( FT_QRENEW_ARRAY( font->props,
+ font->props_size,
+ font->props_size + 1 ) )
goto Exit;
fp = font->props + font->props_size;
@@ -2279,9 +2279,9 @@
if ( p->font->comments_len > 0 )
{
- if ( FT_RENEW_ARRAY( p->font->comments,
- p->font->comments_len,
- p->font->comments_len + 1 ) )
+ if ( FT_QRENEW_ARRAY( p->font->comments,
+ p->font->comments_len,
+ p->font->comments_len + 1 ) )
goto Fail;
p->font->comments[p->font->comments_len] = 0;
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 439bc6c..060554a 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -613,7 +613,7 @@ THE SOFTWARE.
strings[string_size] = '\0';
- if ( FT_NEW_ARRAY( properties, nprops ) )
+ if ( FT_QNEW_ARRAY( properties, nprops ) )
goto Bail;
face->properties = properties;
@@ -766,7 +766,7 @@ THE SOFTWARE.
face->nmetrics = nmetrics + 1;
- if ( FT_NEW_ARRAY( face->metrics, face->nmetrics ) )
+ if ( FT_QNEW_ARRAY( face->metrics, face->nmetrics ) )
return error;
/* we handle glyph index 0 later on */