diff options
Diffstat (limited to 'src/base/ftbitmap.c')
-rw-r--r-- | src/base/ftbitmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c index 8810cfad..46fcce61 100644 --- a/src/base/ftbitmap.c +++ b/src/base/ftbitmap.c @@ -228,8 +228,12 @@ if ( !bitmap || !bitmap->buffer ) return FT_Err_Invalid_Argument; - xstr = FT_PIX_ROUND( xStrength ) >> 6; - ystr = FT_PIX_ROUND( yStrength ) >> 6; + if ( ( ( FT_PIX_ROUND( xStrength ) >> 6 ) > FT_INT_MAX ) || + ( ( FT_PIX_ROUND( yStrength ) >> 6 ) > FT_INT_MAX ) ) + return FT_Err_Invalid_Argument; + + xstr = (FT_Int)FT_PIX_ROUND( xStrength ) >> 6; + ystr = (FT_Int)FT_PIX_ROUND( yStrength ) >> 6; if ( xstr == 0 && ystr == 0 ) return FT_Err_Ok; |