| OLD | NEW |
| 1 | 1 |
| 2 /* pngmem.c - stub functions for memory allocation | 2 /* pngmem.c - stub functions for memory allocation |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.41 [February 25, 2010] | 4 * Last changed in libpng 1.2.41 [February 25, 2010] |
| 5 * Copyright (c) 1998-2010 Glenn Randers-Pehrson | 5 * Copyright (c) 1998-2010 Glenn Randers-Pehrson |
| 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 8 * | 8 * |
| 9 * This code is released under the libpng license. | 9 * This code is released under the libpng license. |
| 10 * For conditions of distribution and use, see the disclaimer | 10 * For conditions of distribution and use, see the disclaimer |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 /* Allocate memory. For reasonable files, size should never exceed | 438 /* Allocate memory. For reasonable files, size should never exceed |
| 439 * 64K. However, zlib may allocate more then 64K if you don't tell | 439 * 64K. However, zlib may allocate more then 64K if you don't tell |
| 440 * it not to. See zconf.h and png.h for more information. zlib does | 440 * it not to. See zconf.h and png.h for more information. zlib does |
| 441 * need to allocate exactly 64K, so whatever you call here must | 441 * need to allocate exactly 64K, so whatever you call here must |
| 442 * have the ability to do that. | 442 * have the ability to do that. |
| 443 */ | 443 */ |
| 444 | 444 |
| 445 png_voidp PNGAPI | 445 png_voidp /* PRIVATE */ |
| 446 png_calloc(png_structp png_ptr, png_uint_32 size) | 446 png_calloc(png_structp png_ptr, png_uint_32 size) |
| 447 { | 447 { |
| 448 png_voidp ret; | 448 png_voidp ret; |
| 449 | 449 |
| 450 ret = (png_malloc(png_ptr, size)); | 450 ret = (png_malloc(png_ptr, size)); |
| 451 if (ret != NULL) | 451 if (ret != NULL) |
| 452 png_memset(ret,0,(png_size_t)size); | 452 png_memset(ret,0,(png_size_t)size); |
| 453 return (ret); | 453 return (ret); |
| 454 } | 454 } |
| 455 | 455 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 */ | 632 */ |
| 633 png_voidp PNGAPI | 633 png_voidp PNGAPI |
| 634 png_get_mem_ptr(png_structp png_ptr) | 634 png_get_mem_ptr(png_structp png_ptr) |
| 635 { | 635 { |
| 636 if (png_ptr == NULL) | 636 if (png_ptr == NULL) |
| 637 return (NULL); | 637 return (NULL); |
| 638 return ((png_voidp)png_ptr->mem_ptr); | 638 return ((png_voidp)png_ptr->mem_ptr); |
| 639 } | 639 } |
| 640 #endif /* PNG_USER_MEM_SUPPORTED */ | 640 #endif /* PNG_USER_MEM_SUPPORTED */ |
| 641 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ | 641 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ |
| OLD | NEW |