mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Handle zero-length PLTE chunk or NULL palette with png_error()
instead of png_chunk_report(), which by default issues a warning rather than an error, leading to later reading from a NULL pointer (png_ptr->palette) in png_do_expand_palette().
This commit is contained in:
@@ -1839,6 +1839,9 @@ png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr)
|
||||
|
||||
info_ptr->bit_depth = 8;
|
||||
info_ptr->num_trans = 0;
|
||||
|
||||
if (png_ptr->palette == NULL)
|
||||
png_error (png_ptr, "Palette is NULL in indexed image");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user