* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/ChangeLog b/ChangeLog
index 4596ba6..056d205 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-25 Werner Lemberg <wl@gnu.org>
+
+ * 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 <mpsuzuki@hiroshima-u.ac.jp>
* src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 9a96fb8..86d77d4 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -3331,7 +3331,8 @@ static const char count_table[256] =
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 @@ static const char count_table[256] =
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;