From 65b96aad1e2d43b60b3a5026b82dd553cf26180a Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 7 Mar 2006 00:38:24 +0000 Subject: [PATCH] * src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes in Mozilla/FireFox print preview in Ubuntu Hoary --- ChangeLog | 7 ++++++- src/cache/ftcmanag.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index de3b762cb..1a32225a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-06 David Turner + + * src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes + in Mozilla/FireFox print preview in Ubuntu Hoary + 2006-02-28 Chia-I Wu * src/base/ftutil.c (ft_mem_qalloc) [FT_STRICT_ALIASING]: Do not @@ -40,7 +45,7 @@ * src/cache/ftccache.c (ftc_node_destroy): Mark as FT_BASE_DEF since it needs to be exported for rogue clients. - + * src/pshinter/pshglob.c (psh_blues_set_zones_0): Prevent problems with malformed fonts which have an odd number of blue values (these are broken according to the specs). diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c index fe4fa0275..c07bc3259 100644 --- a/src/cache/ftcmanag.c +++ b/src/cache/ftcmanag.c @@ -698,6 +698,7 @@ FTC_ScalerRec scaler; FT_Error error; FT_Size size; + FT_Face face; scaler.face_id = font->face_id; @@ -710,14 +711,17 @@ error = FTC_Manager_LookupSize( manager, &scaler, &size ); if ( error ) { - *aface = NULL; - *asize = NULL; + face = NULL; + size = NULL; } else - { - *aface = size->face; + face = size->face; + + if ( aface ) + *aface = face; + + if ( asize ) *asize = size; - } return error; }