* 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.
This commit is contained in:
David Turner 2006-11-28 08:38:31 +00:00
parent 80658e5075
commit 3a18c5e29e
2 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2006-11-28 David Turner <david@freetype.org> 2006-11-28 David Turner <david@freetype.org>
* 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/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch
* src/smooth/ftgrays.c: remove hard-coded error values, use FreeType * src/smooth/ftgrays.c: remove hard-coded error values, use FreeType

View File

@ -1783,9 +1783,18 @@
return ErrRaster_Invalid_Outline; return ErrRaster_Invalid_Outline;
/* if direct mode is not set, we must have a target bitmap */ /* 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) == 0 )
( !target_map || !target_map->buffer ) ) {
return ErrRaster_Invalid_Argument; 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 */ /* this version does not support monochrome rendering */
if ( !( params->flags & FT_RASTER_FLAG_AA ) ) if ( !( params->flags & FT_RASTER_FLAG_AA ) )