From 1fe283cc8523373ebf0fc9ab1bec11b17c716034 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 12 Dec 2021 10:12:00 +0000 Subject: [PATCH] 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). --- libvips/foreign/nsgifload.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libvips/foreign/nsgifload.c b/libvips/foreign/nsgifload.c index 138e973b..89e6d7a5 100644 --- a/libvips/foreign/nsgifload.c +++ b/libvips/foreign/nsgifload.c @@ -577,13 +577,12 @@ vips_foreign_load_nsgif_class_init( VipsForeignLoadNsgifClass *class ) static void * vips_foreign_load_nsgif_bitmap_create( int width, int height ) { - /* Enforce max GIF dimensions of 16383 (0x7FFF). This should be enough - * for anyone, and will prevent the worst GIF bombs. + /* GIF has a limit of 64k per axis -- double-check this. */ if( width <= 0 || - width > 16383 || + width > 65536 || height <= 0 || - height > 16383 ) { + height > 65536 ) { vips_error( "gifload", "%s", _( "bad image dimensions") ); return( NULL );