raise the PNG text chunk limit

Raise the PNG text chunk limit to 50, since it seems some real images
have a text chunk per line of exif data.

See https://github.com/libvips/libvips/issues/2433
This commit is contained in:
John Cupitt 2021-09-13 14:40:20 +01:00
parent c5a6331d5e
commit 15416c410d
2 changed files with 5 additions and 2 deletions

View File

@ -45,7 +45,9 @@ extern "C" {
)
#endif /*HAVE_CHECKED_MUL*/
#define MAX_PNG_TEXT_CHUNKS 20
/* We've seen real images with 28 chunks, so set 50.
*/
#define MAX_PNG_TEXT_CHUNKS 50
void vips__tiff_init( void );

View File

@ -570,7 +570,8 @@ png2vips_header( Read *read, VipsImage *out )
if( !read->unlimited &&
num_text > MAX_PNG_TEXT_CHUNKS ) {
vips_error( "vipspng",
"%s", _( "too many text chunks" ) );
_( "%d text chunks, image blocked" ),
num_text );
return( -1 );
}