remove GIF frame size limit

We limited GIFs to 16k on an axis, but there are a few larger than
this. Check for 64k instead (the GIF format limit).
This commit is contained in:
John Cupitt 2021-12-12 10:12:00 +00:00
parent 6d23a3615e
commit 1fe283cc85

View File

@ -577,13 +577,12 @@ vips_foreign_load_nsgif_class_init( VipsForeignLoadNsgifClass *class )
static void * static void *
vips_foreign_load_nsgif_bitmap_create( int width, int height ) vips_foreign_load_nsgif_bitmap_create( int width, int height )
{ {
/* Enforce max GIF dimensions of 16383 (0x7FFF). This should be enough /* GIF has a limit of 64k per axis -- double-check this.
* for anyone, and will prevent the worst GIF bombs.
*/ */
if( width <= 0 || if( width <= 0 ||
width > 16383 || width > 65536 ||
height <= 0 || height <= 0 ||
height > 16383 ) { height > 65536 ) {
vips_error( "gifload", vips_error( "gifload",
"%s", _( "bad image dimensions") ); "%s", _( "bad image dimensions") );
return( NULL ); return( NULL );