Don't fail if PNG contains too much text chunks (#2803)
Only warn if PNG contains too many text chunks Update spngload.c
This commit is contained in:
parent
7561d4e52c
commit
982cbe5f8a
@ -258,9 +258,9 @@ vips_foreign_load_png_set_header( VipsForeignLoadPng *png, VipsImage *image )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if( !png->unlimited && n_text > MAX_PNG_TEXT_CHUNKS ) {
|
if( !png->unlimited && n_text > MAX_PNG_TEXT_CHUNKS ) {
|
||||||
vips_error( class->nickname,
|
g_warning(_( "%d text chunks, only %d text chunks will be loaded" ),
|
||||||
"%s", _( "too many text chunks" ) );
|
n_text, MAX_PNG_TEXT_CHUNKS );
|
||||||
return( -1 );
|
n_text = MAX_PNG_TEXT_CHUNKS;
|
||||||
}
|
}
|
||||||
|
|
||||||
text = VIPS_ARRAY( VIPS_OBJECT( png ),
|
text = VIPS_ARRAY( VIPS_OBJECT( png ),
|
||||||
|
@ -581,10 +581,9 @@ png2vips_header( Read *read, VipsImage *out )
|
|||||||
*/
|
*/
|
||||||
if( !read->unlimited &&
|
if( !read->unlimited &&
|
||||||
num_text > MAX_PNG_TEXT_CHUNKS ) {
|
num_text > MAX_PNG_TEXT_CHUNKS ) {
|
||||||
vips_error( "vipspng",
|
g_warning(_( "%d text chunks, only %d text chunks will be loaded" ),
|
||||||
_( "%d text chunks, image blocked" ),
|
num_text, MAX_PNG_TEXT_CHUNKS );
|
||||||
num_text );
|
num_text = MAX_PNG_TEXT_CHUNKS;
|
||||||
return( -1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = 0; i < num_text; i++ )
|
for( i = 0; i < num_text; i++ )
|
||||||
|
Loading…
Reference in New Issue
Block a user