[truetype, type1] Use FT_DUP to duplicate data.

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use concise FT_DUP.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Ditto.
* src/type1/t1load.c (parse_subrs): Ditto.
This commit is contained in:
Alexei Podtelezhnikov 2024-05-19 22:48:13 -04:00
parent cdd3572e52
commit d7cf931ac6
3 changed files with 4 additions and 9 deletions

View File

@ -418,11 +418,9 @@
/* and thus allocate the bytecode array size by ourselves */
if ( n_ins )
{
if ( FT_QNEW_ARRAY( exec->glyphIns, n_ins ) )
if ( FT_DUP( exec->glyphIns, p, n_ins ) )
return error;
FT_MEM_COPY( exec->glyphIns, p, (FT_Long)n_ins );
exec->glyphSize = n_ins;
}
}

View File

@ -2722,9 +2722,8 @@
FT_UInt n;
if ( FT_ALLOC( mmvar, ttface->blend->mmvar_len ) )
if ( FT_DUP( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ) )
goto Exit;
FT_MEM_COPY( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len );
axis_flags =
(FT_UShort*)( (char*)mmvar + mmvar_size );

View File

@ -1877,9 +1877,8 @@
}
/* t1_decrypt() shouldn't write to base -- make temporary copy */
if ( FT_QALLOC( temp, size ) )
if ( FT_DUP( temp, base, size ) )
goto Fail;
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
size -= (FT_ULong)t1face->type1.private_dict.lenIV;
error = T1_Add_Table( table,
@ -2091,9 +2090,8 @@
}
/* t1_decrypt() shouldn't write to base -- make temporary copy */
if ( FT_QALLOC( temp, size ) )
if ( FT_DUP( temp, base, size ) )
goto Fail;
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
size -= (FT_ULong)t1face->type1.private_dict.lenIV;
error = T1_Add_Table( code_table,