* src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes

in Mozilla/FireFox print preview in Ubuntu Hoary
This commit is contained in:
David Turner 2006-03-07 00:38:24 +00:00
parent 91a3faaac9
commit 65b96aad1e
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2006-03-06 David Turner <david@freetype.org>
* src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes
in Mozilla/FireFox print preview in Ubuntu Hoary
2006-02-28 Chia-I Wu <b90201047@ntu.edu.tw> 2006-02-28 Chia-I Wu <b90201047@ntu.edu.tw>
* src/base/ftutil.c (ft_mem_qalloc) [FT_STRICT_ALIASING]: Do not * 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 * src/cache/ftccache.c (ftc_node_destroy): Mark as FT_BASE_DEF since
it needs to be exported for rogue clients. it needs to be exported for rogue clients.
* src/pshinter/pshglob.c (psh_blues_set_zones_0): Prevent problems * src/pshinter/pshglob.c (psh_blues_set_zones_0): Prevent problems
with malformed fonts which have an odd number of blue values (these with malformed fonts which have an odd number of blue values (these
are broken according to the specs). are broken according to the specs).

14
src/cache/ftcmanag.c vendored
View File

@ -698,6 +698,7 @@
FTC_ScalerRec scaler; FTC_ScalerRec scaler;
FT_Error error; FT_Error error;
FT_Size size; FT_Size size;
FT_Face face;
scaler.face_id = font->face_id; scaler.face_id = font->face_id;
@ -710,14 +711,17 @@
error = FTC_Manager_LookupSize( manager, &scaler, &size ); error = FTC_Manager_LookupSize( manager, &scaler, &size );
if ( error ) if ( error )
{ {
*aface = NULL; face = NULL;
*asize = NULL; size = NULL;
} }
else else
{ face = size->face;
*aface = size->face;
if ( aface )
*aface = face;
if ( asize )
*asize = size; *asize = size;
}
return error; return error;
} }