[libpng16] Added png_ptr->process_mode = PNG_READ_IDAT_MODE in

png_push_read_chunk after recognizing the IDAT chunk, which avoids an
infinite loop while reading a datastream whose first IDAT chunk is of
zero-length.
This commit is contained in:
Glenn Randers-Pehrson
2014-02-22 21:59:40 -06:00
parent f5df058bee
commit eb657ae68f
4 changed files with 19 additions and 8 deletions

View File

@@ -228,7 +228,7 @@ png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
else
{
png_chunk_benign_error(png_ptr, "CRC error");
png_chunk_error(png_ptr, "CRC error");
return (0);
}
@@ -322,6 +322,8 @@ png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
{
#ifdef PNG_ERROR_TEXT_SUPPORTED
png_chunk_error(png_ptr, "insufficient memory to read chunk");
#else
png_err(png_ptr);
#endif
}
}