* src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case

of error -- `avar' is optional so we can't rely on tt_done_blend
being called automatically.
This commit is contained in:
Werner Lemberg 2004-05-11 06:45:27 +00:00
parent 19b42a5c3a
commit ee6e92c28e
2 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2004-05-10 George Williams <gww@silcom.com>
* src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case
of error -- `avar' is optional so we can't rely on tt_done_blend
being called automatically.
2004-05-09 George Williams <gww@silcom.com> 2004-05-09 George Williams <gww@silcom.com>
* src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix * src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix

View File

@ -304,7 +304,17 @@
{ {
segment->pairCount = FT_GET_USHORT(); segment->pairCount = FT_GET_USHORT();
if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) ) if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) )
{
/* Failure. Free everything we have done so far. We must do */
/* it right now since loading the `avar' table is optional. */
for ( j = i - 1; j >= 0; --j )
FT_FREE( blend->avar_segment[j].correspondence );
FT_FREE( blend->avar_segment );
blend->avar_segment = NULL;
goto Exit; goto Exit;
}
for ( j = 0; j < segment->pairCount; ++j ) for ( j = 0; j < segment->pairCount; ++j )
{ {