summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2021-05-07 19:17:48 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-05-07 19:17:48 -0400
commit967a34eee3fd34f496366ed1283ab5268d23690a (patch)
treec26a54bb332e96dfe4ca354869ff362c68ba837f
parent2f62d8e075656e6b5fb597e681ba4b2b8296900c (diff)
downloadfreetype2-967a34eee3fd34f496366ed1283ab5268d23690a.tar.gz
[type1] Avoid MM memory zeroing.
* src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map): Tweak allocation macros. * src/type1/t1objs.c (T1_Face_Done): Minor.
-rw-r--r--ChangeLog8
-rw-r--r--src/type1/t1load.c14
-rw-r--r--src/type1/t1objs.c1
3 files changed, 15 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 54b07b15c..ead7ae2ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2021-05-07 Alexei Podtelezhnikov <apodtele@gmail.com>
+ [type1] Avoid MM memory zeroing.
+
+ * src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map):
+ Tweak allocation macros.
+ * src/type1/t1objs.c (T1_Face_Done): Minor.
+
+2021-05-07 Alexei Podtelezhnikov <apodtele@gmail.com>
+
* src/bdf/bdflib.c (_bdf_list_ensure): Tweak allocation macro.
2021-05-06 Alexei Podtelezhnikov <apodtele@gmail.com>
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index fe6239f98..497c26aa7 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -130,10 +130,10 @@
/* allocate the blend `private' and `font_info' dictionaries */
- if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs ) ||
- FT_NEW_ARRAY( blend->privates [1], num_designs ) ||
- FT_NEW_ARRAY( blend->bboxes [1], num_designs ) ||
- FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) )
+ if ( FT_QNEW_ARRAY( blend->font_infos[1], num_designs ) ||
+ FT_QNEW_ARRAY( blend->privates [1], num_designs ) ||
+ FT_QNEW_ARRAY( blend->bboxes [1], num_designs ) ||
+ FT_QNEW_ARRAY( blend->weight_vector, num_designs * 2 ) )
goto Exit;
blend->default_weight_vector = blend->weight_vector + num_designs;
@@ -167,12 +167,12 @@
/* allocate the blend design pos table if needed */
num_designs = blend->num_designs;
num_axis = blend->num_axis;
- if ( num_designs && num_axis && blend->design_pos[0] == 0 )
+ if ( num_designs && num_axis && blend->design_pos[0] == NULL )
{
FT_UInt n;
- if ( FT_NEW_ARRAY( blend->design_pos[0], num_designs * num_axis ) )
+ if ( FT_QNEW_ARRAY( blend->design_pos[0], num_designs * num_axis ) )
goto Exit;
for ( n = 1; n < num_designs; n++ )
@@ -1044,7 +1044,7 @@
}
/* allocate design map data */
- if ( FT_NEW_ARRAY( map->design_points, num_points * 2 ) )
+ if ( FT_QNEW_ARRAY( map->design_points, num_points * 2 ) )
goto Exit;
map->blend_points = map->design_points + num_points;
map->num_points = (FT_Byte)num_points;
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 9274c4a72..ec202be29 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -217,7 +217,6 @@
{
FT_FREE( face->buildchar );
- face->buildchar = NULL;
face->len_buildchar = 0;
}