Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pngpread.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ png_push_read_chunk(png_struct *png_ptr, png_info *info_ptr)
png_push_save_buffer(png_ptr);
return;
}

if (PNG_CHUNK_CRITICAL(chunk_name))
png_error(png_ptr, "Unexpected critical chunk in APNG sequence");

png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence");
png_crc_finish(png_ptr, png_ptr->push_length);
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
Expand Down Expand Up @@ -571,6 +575,11 @@ png_push_read_IDAT(png_struct *png_ptr)
png_push_save_buffer(png_ptr);
return;
}

if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
png_error(png_ptr,
"Unexpected critical chunk in APNG sequence");

png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence");
png_crc_finish(png_ptr, png_ptr->push_length);
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
Expand Down
3 changes: 3 additions & 0 deletions pngread.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ png_read_frame_head(png_struct *png_ptr, png_info *info_ptr)
}
else
{
if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
png_error(png_ptr, "Unexpected critical chunk in APNG sequence");

png_warning(png_ptr, "Ignoring unexpected chunk in APNG sequence");
png_crc_finish(png_ptr, length);
}
Expand Down
4 changes: 4 additions & 0 deletions pngrutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -4360,6 +4360,10 @@ png_read_IDAT_data(png_struct *png_ptr, png_byte *output,
png_error(png_ptr, "Not enough image data");
if (png_ptr->chunk_name != png_fdAT)
{
if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
png_error(png_ptr,
"Unexpected critical chunk in APNG sequence");

png_warning(png_ptr,
"Ignoring unexpected chunk in APNG sequence");
bytes_to_skip = png_ptr->idat_size;
Expand Down