From 4e0c9ee155caa181072d90573bd3e4b2693f32ce Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Thu, 24 Sep 2009 14:30:40 +0900 Subject: [PATCH] [cache] Check the face filled by FTC_Manager_LookupFace(). --- ChangeLog | 8 ++++++++ src/cache/ftcbasic.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 683dfcb21..a3e006bee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-24 suzuki toshiya + + [cache] Check the face filled by FTC_Manager_LookupFace(). + + * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return + immediately if FTC_Manager_LookupFace() fills face by NULL. + Such case can occur when the code is optimized by GCC-4.2.x. + 2009-09-23 Werner Lemberg * docs/CHANGES: Updated. diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c index e329d31fe..32e6b433d 100644 --- a/src/cache/ftcbasic.c +++ b/src/cache/ftcbasic.c @@ -142,6 +142,9 @@ error = FTC_Manager_LookupFace( manager, family->attrs.scaler.face_id, &face ); + if ( error || !face ) + return result; + if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs ) { FT_TRACE1(( "ftc_basic_family_get_count: too large number of glyphs " ));