Merge pull request #1424 from OrderMyGear/png-max-malloc-buffer
also set png max chunk malloc when reading buffer
This commit is contained in:
commit
64898330e4
@ -812,7 +812,13 @@ read_new_buffer( VipsImage *out, const void *buffer, size_t length,
|
||||
|
||||
/* Read enough of the file that png_get_interlace_type() will start
|
||||
* working.
|
||||
*
|
||||
* By default, libpng refuses to open files with a metadata chunk
|
||||
* larger than 8mb. We've seen real files with 20mb, so set 50mb.
|
||||
*/
|
||||
#ifdef HAVE_PNG_SET_CHUNK_MALLOC_MAX
|
||||
png_set_chunk_malloc_max( read->pPng, 50 * 1024 * 1024 );
|
||||
#endif /*HAVE_PNG_SET_CHUNK_MALLOC_MAX*/
|
||||
png_read_info( read->pPng, read->pInfo );
|
||||
|
||||
return( read );
|
||||
|
Loading…
Reference in New Issue
Block a user