From 832f19b2a8ab49a100eeeef8811846d192844771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wu=2C=20Chia-I=20=28=E5=90=B3=E4=BD=B3=E4=B8=80=29?= Date: Sat, 20 Aug 2005 08:17:44 +0000 Subject: * src/truetype/ttdriver.c (Load_Glyph): Don't check the validity of ttmetrics here. TrueType fonts with only sbits always have ttmetrics.valid set to false. * src/truetype/ttgload.c (TT_Load_Glyph): Check that ttmetrics is valid before loading outline glyph. * src/cache/ftcimage.c (FTC_INode_New): Fix a memory leak. --- ChangeLog | 11 +++++++++++ src/cache/ftcimage.c | 5 +++++ src/truetype/ttdriver.c | 2 +- src/truetype/ttgload.c | 3 +++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 87e70ce28..251a6f8a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-08-20 Chia I Wu + + * src/truetype/ttdriver.c (Load_Glyph): Don't check the validity of + ttmetrics here. TrueType fonts with only sbits always have + ttmetrics.valid set to false. + + * src/truetype/ttgload.c (TT_Load_Glyph): Check that ttmetrics is + valid before loading outline glyph. + + * src/cache/ftcimage.c (FTC_INode_New): Fix a memory leak. + 2005-08-20 Werner Lemberg * src/sfnt/ttload.c (tt_face_load_metrics_header): Ignore missing diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c index 508ed6c15..02020bac3 100644 --- a/src/cache/ftcimage.c +++ b/src/cache/ftcimage.c @@ -78,6 +78,11 @@ /* we will now load the glyph image */ error = clazz->family_load_glyph( family, gindex, cache, &inode->glyph ); + if ( error ) + { + FTC_INode_Free( inode, cache ); + inode = NULL; + } } *pinode = inode; diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 32803f6d4..71463ff83 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -283,7 +283,7 @@ if ( !slot ) return TT_Err_Invalid_Slot_Handle; - if ( !size || !size->ttmetrics.valid ) + if ( !size ) return TT_Err_Invalid_Size_Handle; if ( load_flags & ( FT_LOAD_NO_RECURSE | FT_LOAD_NO_SCALE ) ) diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index dd4264daf..5a807b3e7 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2029,6 +2029,9 @@ #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + if ( !size->ttmetrics.valid ) + return TT_Err_Invalid_Size_Handle; + if ( load_flags & FT_LOAD_SBITS_ONLY ) return TT_Err_Invalid_Argument; -- cgit v1.2.1