Merge pull request #2362 from lovell/heifload-verify-dimensions

heifload: verify page dimensions are non-zero
This commit is contained in:
John Cupitt 2021-07-26 11:03:56 +01:00 committed by GitHub
commit d43b3ff0f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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",