shithub: freetype+ttf2subf

Download patch

ref: 65b96aad1e2d43b60b3a5026b82dd553cf26180a
parent: 91a3faaac9a4f8ca57ee68f10cb489afa2b59ea0
author: David Turner <[email protected]>
date: Mon Mar 6 19:38:24 EST 2006

* src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes
    in Mozilla/FireFox print preview in Ubuntu Hoary

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-06 David Turner  <[email protected]>
+
+    * src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): prevent crashes
+    in Mozilla/FireFox print preview in Ubuntu Hoary
+
 2006-02-28  Chia-I Wu  <[email protected]>
 
 	* 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).
--- 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;
   }