shithub: freetype+ttf2subf

Download patch

ref: c938131856e288d7dd5d9e7c0437d0097b2ccc0c
parent: 355f1b13d1975020d54891fdb358895da02dbd66
author: Werner Lemberg <[email protected]>
date: Sun May 25 08:19:34 EDT 2008

* src/raster/ftraster.c (fc_black_render): Return 0 when we are
trying to render into a zero-width/height bitmap, not an error code.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-25  Werner Lemberg  <[email protected]>
+
+	* src/raster/ftraster.c (fc_black_render): Return 0 when we are
+	trying to render into a zero-width/height bitmap, not an error code.
+
 2008-05-20  suzuki toshiya  <[email protected]>
 
 	* src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -3331,7 +3331,8 @@
     if ( !outline->contours || !outline->points )
       return Raster_Err_Invalid;
 
-    if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 )
+    if ( outline->n_points !=
+           outline->contours[outline->n_contours - 1] + 1 )
       return Raster_Err_Invalid;
 
     worker = raster->worker;
@@ -3340,7 +3341,14 @@
     if ( params->flags & FT_RASTER_FLAG_DIRECT )
       return Raster_Err_Unsupported;
 
-    if ( !target_map || !target_map->buffer )
+    if ( !target_map )
+      return Raster_Err_Invalid;
+
+    /* nothing to do */
+    if ( !target_map->width || !target_map->rows )
+      return Raster_Err_None;
+
+    if ( !target_map->buffer )
       return Raster_Err_Invalid;
 
     ras.outline  = *outline;