mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Reject invalid compression flag, method when reading the iTXt chunk.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user