From 3a18c5e29efbb463f360c0951530572a5020535f Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 28 Nov 2006 08:38:31 +0000 Subject: [PATCH] * src/smooth/ftgrays.c (gray_raster_render): return 0 when we're trying to rendering into a zero-width/height bitmap, instead of an error code. --- ChangeLog | 4 ++++ src/smooth/ftgrays.c | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 828cbbdb0..9cb6e1a87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-11-28 David Turner + * src/smooth/ftgrays.c (gray_raster_render): return 0 when we're + trying to rendering into a zero-width/height bitmap, instead of an + error code. + * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch * src/smooth/ftgrays.c: remove hard-coded error values, use FreeType diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 448125cf6..e17a5b53d 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -1783,9 +1783,18 @@ return ErrRaster_Invalid_Outline; /* if direct mode is not set, we must have a target bitmap */ - if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 && - ( !target_map || !target_map->buffer ) ) - return ErrRaster_Invalid_Argument; + if ( (params->flags & FT_RASTER_FLAG_DIRECT) == 0 ) + { + if ( !target_map ) + return ErrRaster_Invalid_Argument; + + /* nothing to do */ + if ( !target_map->width || !target_map->rows ) + return 0; + + if ( !target_map->buffer ) + return ErrRaster_Invalid_Argument; + } /* this version does not support monochrome rendering */ if ( !( params->flags & FT_RASTER_FLAG_AA ) )