diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2008-07-25 08:38:43 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2009-04-06 16:17:24 -0500 |
commit | 84d5d968a6361c6411b69286e725ca307c6ca3f9 (patch) | |
tree | 2181562012965f44e6d7cd8b3d3b4616cc1ed7fd /pngmem.c | |
parent | 9c8717e42f2c2afc6ed3178b29d9be200e87f1d2 (diff) | |
download | libpng-84d5d968a6361c6411b69286e725ca307c6ca3f9.tar.gz |
Imported from libpng-1.2.30rc05.tarv1.2.30rc05
Diffstat (limited to 'pngmem.c')
-rw-r--r-- | pngmem.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1,7 +1,7 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.2.30 [July 22, 2008] + * Last changed in libpng 1.2.30 [July 25, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -272,6 +272,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size) /* free a pointer allocated by png_malloc(). In the default configuration, png_ptr is not used, but is passed in case it is needed. If ptr is NULL, return without taking any action. */ + void PNGAPI png_free(png_structp png_ptr, png_voidp ptr) { @@ -543,7 +544,7 @@ png_malloc_warn(png_structp png_ptr, png_uint_32 size) png_uint_32 save_flags; if (png_ptr == NULL) return (NULL); - save_flags=png_ptr->flags; + save_flags = png_ptr->flags; png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; ptr = (png_voidp)png_malloc((png_structp)png_ptr, size); png_ptr->flags=save_flags; @@ -586,10 +587,11 @@ void PNGAPI png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn) { - if (png_ptr != NULL) { - png_ptr->mem_ptr = mem_ptr; - png_ptr->malloc_fn = malloc_fn; - png_ptr->free_fn = free_fn; + if (png_ptr != NULL) + { + png_ptr->mem_ptr = mem_ptr; + png_ptr->malloc_fn = malloc_fn; + png_ptr->free_fn = free_fn; } } |