shithub: freetype+ttf2subf

Download patch

ref: 44c655b01c5f4f436504fa8b275a92e610ac2eb9
parent: edc7d81a7ba3b0116b4280a945fca70f00cfcf4d
author: Werner Lemberg <[email protected]>
date: Sun Feb 17 03:22:08 EST 2008

* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Check for valid callback pointers.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-17  Jonathan Blow  <[email protected]>
+
+	* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
+	Check for valid callback pointers.
+
 2008-02-15  suzuki toshiya  <[email protected]>
 
 	* src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (body).                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008 by                        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -165,9 +165,10 @@
 
       /* now load the slot image into the auto-outline and run the */
       /* automatic hinting process                                 */
-      metrics->clazz->script_hints_apply( hints,
-                                          &gloader->current.outline,
-                                          metrics );
+      if ( metrics->clazz->script_hints_apply )
+        metrics->clazz->script_hints_apply( hints,
+                                            &gloader->current.outline,
+                                            metrics );
 
       /* we now need to hint the metrics according to the change in */
       /* width/positioning that occurred during the hinting process */
@@ -515,9 +516,13 @@
         load_flags |=  FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
         load_flags &= ~FT_LOAD_RENDER;
 
-        error = metrics->clazz->script_hints_init( &loader->hints, metrics );
-        if ( error )
-          goto Exit;
+        if ( metrics->clazz->script_hints_init )
+        {
+          error = metrics->clazz->script_hints_init( &loader->hints,
+                                                     metrics );
+          if ( error )
+            goto Exit;
+        }
 
         error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );
       }