make GIF parse less strict

Some GIFs don't follow the standard very closely. Let them through.

See https://github.com/libvips/libvips/issues/1404
This commit is contained in:
John Cupitt 2019-08-23 15:40:48 +01:00
parent 81c92242d8
commit 4b677fb16a
2 changed files with 9 additions and 5 deletions

View File

@ -9,6 +9,7 @@
- fix build with MSVC
- fix a problem with shinkv tail processing [angelmixu]
- fix a read one byte beyond buffer bug in jpegload
- make GIF parsing less strict
24/5/19 started 8.8.1
- improve realpath() use on older libc

View File

@ -22,6 +22,8 @@
* - init pages to 0 before load
* 14/2/19
* - rework as a sequential loader ... simpler, much lower mem use
* 23/8/18
* - allow GIF read errors during header scan
*/
/*
@ -601,11 +603,12 @@ vips_foreign_load_gif_header( VipsForeignLoad *load )
gif->n_pages = 0;
do {
if( DGifGetRecordType( gif->file, &record ) == GIF_ERROR ) {
vips_foreign_load_gif_error( gif );
return( -1 );
}
do {
/* Don't flag errors during header scan. Some corrupt GIFs
* will fail.
*/
if( DGifGetRecordType( gif->file, &record ) == GIF_ERROR )
continue;
switch( record ) {
case IMAGE_DESC_RECORD_TYPE: