Commit bd0f71aa960cdaf0cdeea26d47792e9d13520bf8

Werner Lemberg 2008-09-22T08:55:44

Fix Savannah bug #24307. * include/freetype/internal/t1types.h (CID_FaceRec), src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'. * src/smooth/ftgrays.c (gray_raster_render): Don't dereference `target_map' if FT_RASTER_FLAG_DIRECT is set. Problem reported by Stephan T. Lavavej <stl@nuwen.net>.

diff --git a/ChangeLog b/ChangeLog
index fed6086..b6a349c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-09-22  John Tytgat  <John.Tytgat@esko.com>
+
+	Fix Savannah bug #24307.
+
+	* include/freetype/internal/t1types.h (CID_FaceRec),
+	src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'.
+
+2008-09-21  Werner Lemberg  <wl@gnu.org>
+
+	* src/smooth/ftgrays.c (gray_raster_render): Don't dereference
+	`target_map' if FT_RASTER_FLAG_DIRECT is set.  Problem reported by
+	Stephan T. Lavavej <stl@nuwen.net>.
+
 2008-09-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* src/otvalid/Jamfile: Add missing target `otvmath' for multi build
@@ -9,7 +22,7 @@
 
 	* src/smooth/ftgrays.c (gray_find_cell): Fix threshold.  The values
 	passed to this function are already `normalized'.  Problem reported
-	by Stephan T. Lavavej  <stl@nuwen.net>.
+	by Stephan T. Lavavej <stl@nuwen.net>.
 
 	* docs/CHANGES: Document it.
 
diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h
index 047c6d5..4b05fa3 100644
--- a/include/freetype/internal/t1types.h
+++ b/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
 /*    Basic Type1/Type2 type definitions and interface (specification      */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -231,7 +231,9 @@ FT_BEGIN_HEADER
     void*            psnames;
     void*            psaux;
     CID_FaceInfoRec  cid;
+#if 0
     void*            afm_data;
+#endif
     CID_Subrs        subrs;
 
     /* since version 2.1 - interface to PostScript hinter */
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 054cf6c..c44ba01 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1881,7 +1881,7 @@
     worker = raster->worker;
 
     /* if direct mode is not set, we must have a target bitmap */
-    if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 )
+    if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
     {
       if ( !target_map )
         return ErrRaster_Invalid_Argument;
@@ -1899,7 +1899,7 @@
       return ErrRaster_Invalid_Mode;
 
     /* compute clipping box */
-    if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 )
+    if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
     {
       /* compute clip box from target pixmap */
       ras.clip_box.xMin = 0;
@@ -1908,9 +1908,7 @@
       ras.clip_box.yMax = target_map->rows;
     }
     else if ( params->flags & FT_RASTER_FLAG_CLIP )
-    {
       ras.clip_box = params->clip_box;
-    }
     else
     {
       ras.clip_box.xMin = -32768L;
@@ -1927,17 +1925,17 @@
     ras.band_size      = raster->band_size;
     ras.num_gray_spans = 0;
 
-    if ( target_map )
-      ras.target = *target_map;
-
-    ras.render_span      = (FT_Raster_Span_Func)gray_render_span;
-    ras.render_span_data = &ras;
-
     if ( params->flags & FT_RASTER_FLAG_DIRECT )
     {
       ras.render_span      = (FT_Raster_Span_Func)params->gray_spans;
       ras.render_span_data = params->user;
     }
+    else
+    {
+      ras.target           = *target_map;
+      ras.render_span      = (FT_Raster_Span_Func)gray_render_span;
+      ras.render_span_data = &ras;
+    }
 
     return gray_convert_glyph( worker );
   }
diff --git a/src/type42/t42types.h b/src/type42/t42types.h
index 6626b04..c7c2db4 100644
--- a/src/type42/t42types.h
+++ b/src/type42/t42types.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 font data types (specification only).                        */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006 by Roberto Alameda.                         */
+/*  Copyright 2002, 2003, 2006, 2008 by Roberto Alameda.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -35,7 +35,9 @@ FT_BEGIN_HEADER
     T1_FontRec      type1;
     const void*     psnames;
     const void*     psaux;
+#if 0
     const void*     afm_data;
+#endif
     FT_Byte*        ttf_data;
     FT_ULong        ttf_size;
     FT_Face         ttf_face;
@@ -48,7 +50,7 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-#endif /* __T1TYPES_H__ */
+#endif /* __T42TYPES_H__ */
 
 
 /* END */