[libpng17] Set counter to prevent additional attempts to cache a chunk

after running out of memory or reaching a potential overflow condition.
This commit is contained in:
Glenn Randers-Pehrson
2013-01-21 16:37:54 -06:00
parent 8aee43d10a
commit 5e8ba1cbbf
5 changed files with 22 additions and 15 deletions

View File

@@ -1658,8 +1658,8 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if (dl > max_dl)
{
png_warning(png_ptr, "sPLT chunk too long");
return;
png_warning(png_ptr, "sPLT chunk too long");
return;
}
new_palette.nentries = (png_int_32)(data_length / entry_size);
@@ -1669,8 +1669,8 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if (new_palette.entries == NULL)
{
png_warning(png_ptr, "sPLT chunk requires too much memory");
return;
png_warning(png_ptr, "sPLT chunk requires too much memory");
return;
}
#ifdef PNG_POINTER_INDEXING_SUPPORTED