[cid] s/FT_ALLOC/FT_QALLOC/ and clean up.

* src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer.
* src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto.
This commit is contained in:
Alexei Podtelezhnikov 2021-04-23 13:48:34 -04:00
parent b3438ccb31
commit baa0f71ddf
3 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com>
[cid] s/FT_ALLOC/FT_QALLOC/ and clean up.
* src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer.
* src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto.
2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com>
[pfr] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.

View File

@ -85,10 +85,10 @@
if ( glyph_data.length != 0 )
{
glyph_length = (FT_ULong)( glyph_data.length - cid->fd_bytes );
(void)FT_ALLOC( charstring, glyph_length );
if ( !error )
ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,
glyph_length );
if ( !FT_QALLOC( charstring, glyph_length ) )
FT_MEM_COPY( charstring, glyph_data.pointer + cid->fd_bytes,
glyph_length );
}
inc->funcs->free_glyph_data( inc->object, &glyph_data );
@ -130,11 +130,9 @@
}
glyph_length = off2 - off1;
if ( glyph_length == 0 )
goto Exit;
if ( FT_ALLOC( charstring, glyph_length ) )
goto Exit;
if ( FT_STREAM_READ_AT( cid->data_offset + off1,
if ( FT_QALLOC( charstring, glyph_length ) ||
FT_STREAM_READ_AT( cid->data_offset + off1,
charstring, glyph_length ) )
goto Exit;
}

View File

@ -590,7 +590,7 @@
data_len = offsets[num_subrs] - offsets[0];
if ( FT_NEW_ARRAY( subr->code, num_subrs + 1 ) ||
FT_ALLOC( subr->code[0], data_len ) )
FT_QALLOC( subr->code[0], data_len ) )
goto Fail;
if ( FT_STREAM_SEEK( cid->data_offset + offsets[0] ) ||
@ -812,7 +812,7 @@
}
/* we must convert the data section from hexadecimal to binary */
if ( FT_ALLOC( face->binary_data, parser->binary_length ) ||
if ( FT_QALLOC( face->binary_data, parser->binary_length ) ||
FT_SET_ERROR( cid_hex_to_binary( face->binary_data,
parser->binary_length,
parser->data_offset,