[libpng15] Reject invalid compression flag, method when reading the iTXt chunk.

This commit is contained in:
Glenn Randers-Pehrson
2011-11-22 11:53:49 -06:00
parent 8500b7720b
commit 12fb29f951
4 changed files with 12 additions and 10 deletions

View File

@@ -2540,9 +2540,9 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
comp_type = *lang++;
}
if (comp_flag && comp_flag != PNG_TEXT_COMPRESSION_zTXt)
if (comp_type || (comp_flag && comp_flag != PNG_TEXT_COMPRESSION_zTXt))
{
png_warning(png_ptr, "Unknown iTXt compression type");
png_warning(png_ptr, "Unknown iTXt compression type or method");
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
return;