mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Clean up coding style in png_set_PLTE()
This commit is contained in:
parent
7a92725e17
commit
97c4072cce
@ -868,10 +868,6 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
|
||||
(1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
|
||||
|
||||
|
||||
if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
@ -889,6 +885,11 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr)
|
||||
* libpng versions. We silently truncate the unused extra palette entries
|
||||
* here.
|
||||
*/
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
max_palette_length = (1 << png_ptr->bit_depth);
|
||||
else
|
||||
max_palette_length = PNG_MAX_PALETTE_LENGTH;
|
||||
|
||||
if (num > max_palette_length)
|
||||
num = max_palette_length;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user