22#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
34 png_free(&dummy_struct,
png_ptr);
36# ifdef PNG_SETJMP_SUPPORTED
38 png_free_jmpbuf(&dummy_struct);
76#ifndef PNG_USER_MEM_SUPPORTED
84# ifdef PNG_MAX_MALLOC_64K
89#ifdef PNG_USER_MEM_SUPPORTED
102#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
103 defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
126 png_error(
png_ptr,
"internal error: array alloc");
136 if (add_elements <= 0 ||
element_size == 0 || old_elements < 0 ||
137 (old_array ==
NULL && old_elements > 0))
138 png_error(
png_ptr,
"internal error: array realloc");
143 if (add_elements <=
INT_MAX - old_elements)
148 if (new_array !=
NULL)
153 if (old_elements > 0)
182 png_error(
png_ptr,
"Out of memory");
187#ifdef PNG_USER_MEM_SUPPORTED
201 png_error(
png_ptr,
"Out of Memory");
222 png_warning(
png_ptr,
"Out of memory");
237#ifdef PNG_USER_MEM_SUPPORTED
255#ifdef PNG_USER_MEM_SUPPORTED
261 malloc_fn, png_free_ptr free_fn)
266 png_ptr->malloc_fn = malloc_fn;
size_t const element_size
#define memcpy(s1, s2, n)
const png_struct *PNG_RESTRICT png_const_structrp
png_struct *PNG_RESTRICT png_structrp
#define PNG_FUNCTION(type, name, args, attributes)
#define PNG_UNUSED(param)
#define png_constcast(type, value)