[base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.

* src/base/ftobjs.c (open_face_PS_from_sfnt_stream,
Mac_Read_sfnt_Resource): Do not zero out the buffer.
* src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
* src/base/ftrfork.c (raccess_make_file_name,
raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto.
This commit is contained in:
Alexei Podtelezhnikov 2021-04-22 22:34:05 -04:00
parent 8a459e5172
commit 44b1ebe514
4 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2021-04-20 Alexei Podtelezhnikov <apodtele@gmail.com>
[base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
* src/base/ftobjs.c (open_face_PS_from_sfnt_stream,
Mac_Read_sfnt_Resource): Do not zero out the buffer.
* src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
* src/base/ftrfork.c (raccess_make_file_name,
raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto.
2021-04-20 Alexei Podtelezhnikov <apodtele@gmail.com>
[cache] Restore SBit copying for unowned (BDF) bitmaps.

View File

@ -631,7 +631,7 @@
old_total_size = total_size;
}
if ( FT_ALLOC( buffer, (FT_Long)total_size ) )
if ( FT_QALLOC( buffer, (FT_Long)total_size ) )
goto Error;
/* Second pass: append all POST data to the buffer, add PFB fields. */
@ -752,7 +752,7 @@
if ( FT_MAC_RFORK_MAX_LEN < sfnt_size )
return FT_THROW( Array_Too_Large );
if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
if ( FT_QALLOC( sfnt_data, (FT_Long)sfnt_size ) )
{
ReleaseResource( sfnt );
return error;

View File

@ -1818,7 +1818,7 @@
if ( error )
goto Exit;
if ( FT_ALLOC( sfnt_ps, (FT_Long)length ) )
if ( FT_QALLOC( sfnt_ps, (FT_Long)length ) )
goto Exit;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_ps, length );
@ -2128,7 +2128,7 @@
if ( error )
goto Exit;
if ( FT_ALLOC( sfnt_data, rlen ) )
if ( FT_QALLOC( sfnt_data, rlen ) )
return error;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen );
if ( error ) {

View File

@ -602,7 +602,7 @@
if ( base_file_len + 6 > FT_INT_MAX )
return FT_THROW( Array_Too_Large );
if ( FT_ALLOC( newpath, base_file_len + 6 ) )
if ( FT_QALLOC( newpath, base_file_len + 6 ) )
return error;
FT_MEM_COPY( newpath, base_file_name, base_file_len );
@ -638,7 +638,7 @@
if ( base_file_len + 18 > FT_INT_MAX )
return FT_THROW( Array_Too_Large );
if ( FT_ALLOC( newpath, base_file_len + 18 ) )
if ( FT_QALLOC( newpath, base_file_len + 18 ) )
return error;
FT_MEM_COPY( newpath, base_file_name, base_file_len );
@ -874,7 +874,7 @@
new_length = ft_strlen( original_name ) + ft_strlen( insertion );
if ( FT_ALLOC( new_name, new_length + 1 ) )
if ( FT_QALLOC( new_name, new_length + 1 ) )
return NULL;
tmp = ft_strrchr( original_name, '/' );