Fix memory leak described in Savannah bug #16768
* src/type1/t1afm.c (T1_Read_Metrics): fix memory leak which happened when the metrics file doesn't have kerning pairs.
This commit is contained in:
parent
f1a23cbf0f
commit
5f1f75076c
|
@ -1,3 +1,11 @@
|
||||||
|
2006-06-07 David Turner <david@freetype.org>
|
||||||
|
|
||||||
|
Fix memory leak described in Savannah bug #16768
|
||||||
|
|
||||||
|
* src/type1/t1afm.c (T1_Read_Metrics): fix memory leak
|
||||||
|
which happened when the metrics file doesn't have kerning
|
||||||
|
pairs.
|
||||||
|
|
||||||
2006-06-06 David Turner <david@freetype.org>
|
2006-06-06 David Turner <david@freetype.org>
|
||||||
|
|
||||||
Fix memory leak described in Savannah bug #16759.
|
Fix memory leak described in Savannah bug #16759.
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
|
|
||||||
#undef KERN_INDEX
|
#undef KERN_INDEX
|
||||||
#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 )
|
#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) )
|
||||||
|
|
||||||
|
|
||||||
/* compare two kerning pairs */
|
/* compare two kerning pairs */
|
||||||
|
@ -233,14 +233,9 @@
|
||||||
T1_Font t1_font = &( (T1_Face)t1_face )->type1;
|
T1_Font t1_font = &( (T1_Face)t1_face )->type1;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_NEW( fi ) )
|
if ( FT_NEW( fi ) ||
|
||||||
return error;
|
FT_FRAME_ENTER( stream->size ) )
|
||||||
|
goto Exit;
|
||||||
if ( FT_FRAME_ENTER( stream->size ) )
|
|
||||||
{
|
|
||||||
FT_FREE( fi );
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
fi->FontBBox = t1_font->font_bbox;
|
fi->FontBBox = t1_font->font_bbox;
|
||||||
fi->Ascender = t1_font->font_bbox.yMax;
|
fi->Ascender = t1_font->font_bbox.yMax;
|
||||||
|
@ -292,11 +287,16 @@
|
||||||
{
|
{
|
||||||
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
|
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
|
||||||
( (T1_Face)t1_face )->afm_data = fi;
|
( (T1_Face)t1_face )->afm_data = fi;
|
||||||
|
fi = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FT_FRAME_EXIT();
|
FT_FRAME_EXIT();
|
||||||
|
|
||||||
|
Exit:
|
||||||
|
if ( fi != NULL )
|
||||||
|
T1_Done_Metrics( memory, fi );
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue