* src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing.

This commit is contained in:
Alexei Podtelezhnikov 2023-02-25 11:02:21 -05:00
parent 3f2ac7d890
commit 74c498a383

View File

@ -320,9 +320,9 @@
sizeof ( FT_UShort ) );
axis_size = mmaster.num_axis * sizeof ( FT_Var_Axis );
if ( FT_ALLOC( mmvar, mmvar_size +
axis_flags_size +
axis_size ) )
if ( FT_QALLOC( mmvar, mmvar_size +
axis_flags_size +
axis_size ) )
goto Exit;
mmvar->num_axis = mmaster.num_axis;
@ -333,8 +333,7 @@
/* to make `FT_Get_Var_Axis_Flags' work: the function expects that the */
/* values directly follow the data of `FT_MM_Var' */
axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size );
for ( i = 0; i < mmaster.num_axis; i++ )
axis_flags[i] = 0;
FT_ARRAY_ZERO( axis_flags, mmaster.num_axis );
mmvar->axis = (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size );
mmvar->namedstyle = NULL;