[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

@@ -81,11 +81,11 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
/* Some compilers complain that this is always true. However, it
* can be false when integer overflow happens.
*/
if (size > 0 && size <= PNG_SIZE_MAX
# ifdef PNG_MAX_MALLOC_64K
&& size <= 65536U
# endif
)
#ifdef PNG_MAX_MALLOC_64K
if (size > 0 && size <= PNG_SIZE_MAX && size <= 65536U)
#else
if (size > 0 && size <= PNG_SIZE_MAX)
#endif
{
#ifdef PNG_USER_MEM_SUPPORTED
if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
@@ -226,8 +226,11 @@ png_free(png_const_structrp png_ptr, png_voidp ptr)
png_ptr->free_fn(png_constcast(png_structrp,png_ptr), ptr);
else
#endif /* USER_MEM */
free(ptr);
#else
free(ptr);
#endif /* USER_MEM */
}
#ifdef PNG_USER_MEM_SUPPORTED