always check mask->scale is non-zero

This commit is contained in:
John Cupitt 2011-05-31 12:24:09 +01:00
parent 770398753c
commit 40a8c8f95d

View File

@ -1119,6 +1119,7 @@ vips_check_imask( const char *domain, INTMASK *mask )
mask->ysize > 1000 || mask->ysize > 1000 ||
mask->xsize <= 0 || mask->xsize <= 0 ||
mask->ysize <= 0 || mask->ysize <= 0 ||
mask->scale == 0 ||
!mask->coeff ) { !mask->coeff ) {
vips_error( domain, "%s", _( "nonsense mask parameters" ) ); vips_error( domain, "%s", _( "nonsense mask parameters" ) );
return( -1 ); return( -1 );
@ -1146,6 +1147,7 @@ vips_check_dmask( const char *domain, DOUBLEMASK *mask )
mask->ysize > 1000 || mask->ysize > 1000 ||
mask->xsize <= 0 || mask->xsize <= 0 ||
mask->ysize <= 0 || mask->ysize <= 0 ||
mask->scale == 0 ||
!mask->coeff ) { !mask->coeff ) {
vips_error( domain, "%s", _( "nonsense mask parameters" ) ); vips_error( domain, "%s", _( "nonsense mask parameters" ) );
return( -1 ); return( -1 );