[libpng16] Renamed "assert" to "affirm", not affected by NDEBUG.

This commit is contained in:
Glenn Randers-Pehrson
2015-03-21 21:33:42 -05:00
parent 9f2fb72c67
commit 06963c7841
10 changed files with 70 additions and 96 deletions

View File

@@ -120,7 +120,7 @@ PNG_FUNCTION(png_voidp /* PRIVATE */,
png_malloc_array,(png_const_structrp png_ptr, int nelements,
size_t element_size),PNG_ALLOCATED)
{
assert(nelements > 0 && element_size > 0);
affirm(nelements > 0 && element_size > 0);
return png_malloc_array_checked(png_ptr, nelements, element_size);
}
@@ -129,7 +129,7 @@ png_realloc_array,(png_structrp png_ptr, png_const_voidp old_array,
int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED)
{
/* These are internal errors: */
assert(add_elements > 0 && element_size > 0 && old_elements >= 0 &&
affirm(add_elements > 0 && element_size > 0 && old_elements >= 0 &&
(old_array != NULL || old_elements == 0));
/* Check for overflow on the elements count (so the caller does not have to