nsgifload: Fix gif decoding issue. (#2702)

The nsgif_data_scan() call returns an error code that says
if anything was wrong with the source data.

It is not unusual for there to be bad stuff in a GIF, so we
only need to worry if we failed to find any frames.
This commit is contained in:
Michael Drake 2022-03-03 18:49:31 +00:00 committed by GitHub
parent f65b615a17
commit ac35124f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -324,7 +324,8 @@ vips_foreign_load_nsgif_header( VipsForeignLoad *load )
#ifdef VERBOSE
print_animation( gif->anim, gif->info );
#endif /*VERBOSE*/
if( result != NSGIF_OK ) {
if( result != NSGIF_OK &&
load->fail_on >= VIPS_FAIL_ON_WARNING ) {
vips_foreign_load_nsgif_error( gif, result );
return( -1 );
}