mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2026-05-07 20:28:02 +02:00
In function CFF_Done_Font, make sure that subfonts are freed only if
we are working with a CID keyed CFF font. This is to avoid freeing a variable that might not have been allocated.
This commit is contained in:
parent
c5d0d00cdc
commit
c1130459e8
1 changed files with 7 additions and 4 deletions
|
|
@ -2242,11 +2242,14 @@
|
|||
cff_done_index( &font->name_index );
|
||||
cff_done_index( &font->charstrings_index );
|
||||
|
||||
/* release font dictionaries */
|
||||
for ( index = 0; index < font->num_subfonts; index++ )
|
||||
CFF_Done_SubFont( memory, font->subfonts[index] );
|
||||
/* release font dictionaries, but only if working with a CID keyed CFF font */
|
||||
if ( font->num_subfonts > 0 )
|
||||
{
|
||||
for ( index = 0; index < font->num_subfonts; index++ )
|
||||
CFF_Done_SubFont( memory, font->subfonts[index] );
|
||||
|
||||
FREE( font->subfonts );
|
||||
FREE( font->subfonts );
|
||||
}
|
||||
|
||||
CFF_Done_Encoding( &font->encoding, font->stream );
|
||||
CFF_Done_Charset( &font->charset, font->stream );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue