heifload: verify page dimensions are non-zero

This commit is contained in:
Lovell Fuller 2021-07-25 21:47:55 +01:00
parent 08d3c32868
commit 81009d3e4c
1 changed files with 7 additions and 0 deletions

View File

@ -445,6 +445,13 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out )
if( vips_foreign_load_heif_set_page( heif, heif->page, FALSE ) )
return( -1 );
/* Verify dimensions
*/
if ( heif->page_width < 1 || heif->page_height < 1 ) {
vips_error( "heifload", "%s", _( "bad dimensions" ) );
return( -1 );
}
heif->has_alpha = heif_image_handle_has_alpha_channel( heif->handle );
#ifdef DEBUG
printf( "heif_image_handle_has_alpha_channel() = %d\n",