[libpng17] Clean up some conditional compilation of parts of statements

and fixed some indentation
This commit is contained in:
Glenn Randers-Pehrson
2015-11-21 19:14:37 -06:00
parent 3a866cb451
commit daf4b9dd18
4 changed files with 52 additions and 47 deletions

View File

@@ -524,13 +524,14 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
}
}
if ((num_palette > 0 && palette == NULL) ||
(num_palette == 0
# ifdef PNG_MNG_FEATURES_SUPPORTED
&& (png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0
# endif /* MNG_FEATURES */
))
#ifdef PNG_MNG_FEATURES_SUPPORTED
if ((num_palette > 0 && palette == NULL) || (num_palette == 0 &&
(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0))
png_error(png_ptr, "Invalid palette");
#else
if ((num_palette > 0 && palette == NULL) || (num_palette == 0))
png_error(png_ptr, "Invalid palette");
#endif /* MNG_FEATURES */
/* It may not actually be necessary to set png_ptr->palette here;
* we do it for backward compatibility with the way the png_handle_tRNS