summaryrefslogtreecommitdiff
path: root/pngmem.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-12-21 18:11:51 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-12-21 18:11:51 -0600
commit3c1c95399bb2c64b9423c6aab3d9fd0cc1a15619 (patch)
tree7348271c52b0eb54ecd3cdc2cde55d9248c678ee /pngmem.c
parentd332c67da7818132e462fc44ec28b0b7420bc5b5 (diff)
downloadlibpng-3c1c95399bb2c64b9423c6aab3d9fd0cc1a15619.tar.gz
[libpng16] Added #ifdef PNG_USER_MEM_SUPPORTED in pngmem.c where needed.
Diffstat (limited to 'pngmem.c')
-rw-r--r--pngmem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pngmem.c b/pngmem.c
index daed74588..7f0620176 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -72,16 +72,21 @@ png_malloc_base,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
* to implement a user memory handler. This checks to be sure it isn't
* called with big numbers.
*/
+#ifdef PNG_USER_MEM_SUPPORTED
+ PNG_UNUSED(png_ptr)
+#endif
if (size > 0 && size <= ~(size_t)0
# ifdef PNG_MAX_MALLOC_64K
&& size <= 65536U
# endif
)
{
+#ifdef PNG_USER_MEM_SUPPORTED
if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
return png_ptr->malloc_fn(png_ptr, size);
else
+#endif
return malloc((size_t)size); /* checked for truncation above */
}