shithub: freetype+ttf2subf

Download patch

ref: 3d507fefe822ad598b7a47f1561ee1ff2782ce37
parent: ce280a22e2be51af15c3c8b88d3ad5e631950870
author: Werner Lemberg <[email protected]>
date: Sun Jun 3 12:54:55 EDT 2007

* src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
(T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
face == NULL.  Suggested by Graham Asher.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-03  Werner Lemberg  <[email protected]>
+
+	* src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
+	(T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
+	face == NULL.  Suggested by Graham Asher.
+
 2007-06-03  Ismail Dönmez  <[email protected]>
 
 	* src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -787,6 +787,9 @@
     FT_Int  n;
 
 
+    if ( !face )
+      return;
+
     for ( n = 0; n < face->num_charmaps; n++ )
     {
       FT_CMap  cmap = FT_CMAP( face->charmaps[n] );
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 objects manager (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -191,13 +191,11 @@
   FT_LOCAL_DEF( void )
   T1_Face_Done( T1_Face  face )
   {
-    FT_Memory  memory;
-    T1_Font    type1 = &face->type1;
-
-
     if ( face )
     {
-      memory = face->root.memory;
+      FT_Memory  memory = face->root.memory;
+      T1_Font    type1  = &face->type1;
+
 
 #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
       /* release multiple masters information */
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver for Windows FNT/FON files                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -386,13 +386,16 @@
   static void
   FNT_Face_Done( FNT_Face  face )
   {
-    FT_Memory  memory = FT_FACE_MEMORY( face );
+    if ( face )
+    {
+      FT_Memory  memory = FT_FACE_MEMORY( face );
 
 
-    fnt_font_done( face );
+      fnt_font_done( face );
 
-    FT_FREE( face->root.available_sizes );
-    face->root.num_fixed_sizes = 0;
+      FT_FREE( face->root.available_sizes );
+      face->root.num_fixed_sizes = 0;
+    }
   }