fix large animated web support

we were not checking image bounds correctly for very large animated webp
images

thanks pomirleanu

see https://github.com/libvips/libvips/issues/1730
This commit is contained in:
John Cupitt 2020-07-20 14:59:36 +01:00
parent cba371a9ba
commit d93d9bb43b
1 changed files with 3 additions and 1 deletions

View File

@ -506,10 +506,12 @@ read_header( Read *read, VipsImage *out )
read->frame_count = 1;
}
/* height can be huge if this is an animated webp image.
*/
if( read->width <= 0 ||
read->height <= 0 ||
read->width > 0x3FFF ||
read->height > 0x3FFF ) {
read->height > VIPS_MAX_COORD ) {
vips_error( "webp", "%s", _( "bad image dimensions" ) );
return( -1 );
}