diff options
author | Martin Schröder <martin@oneiros.de> | 2008-03-23 16:38:33 +0000 |
---|---|---|
committer | Martin Schröder <martin@oneiros.de> | 2008-03-23 16:38:33 +0000 |
commit | 46b33fcf1608dbdc0e2f48761ae28d30fd520304 (patch) | |
tree | 72bc0f79bca1655628d163040b2348af836b9ed4 /Build/source/libs/libpng/pngwrite.c | |
parent | 0e50747f61798f158b03612ae1e892fbe1e6d979 (diff) |
- import pdftex 1.40.8-alpha-20080323
- update xpdf to 3.02pl2
- update libpng to 1.2.25
git-svn-id: svn://tug.org/texlive/trunk@7095 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/libpng/pngwrite.c')
-rw-r--r-- | Build/source/libs/libpng/pngwrite.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/Build/source/libs/libpng/pngwrite.c b/Build/source/libs/libpng/pngwrite.c index b1f6a593aae..8b01025f540 100644 --- a/Build/source/libs/libpng/pngwrite.c +++ b/Build/source/libs/libpng/pngwrite.c @@ -1,9 +1,9 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.2.24 December 14, 2007 + * Last changed in libpng 1.2.25 [February 18, 2008] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ @@ -482,12 +482,15 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, #endif /* PNG_USER_MEM_SUPPORTED */ png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); - i=0; - do + if(user_png_ver) { - if(user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); + i=0; + do + { + if(user_png_ver[i] != png_libpng_ver[i]) + png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; + } while (png_libpng_ver[i++]); + } if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) { @@ -1000,21 +1003,32 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) #endif } +#ifdef PNG_USER_MEM_SUPPORTED + if (png_ptr != NULL) + { + free_fn = png_ptr->free_fn; + mem_ptr = png_ptr->mem_ptr; + } +#endif + if (info_ptr_ptr != NULL) info_ptr = *info_ptr_ptr; if (info_ptr != NULL) { - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); + if (png_ptr != NULL) + { + png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) - { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list=0; - } + if (png_ptr->num_chunk_list) + { + png_free(png_ptr, png_ptr->chunk_list); + png_ptr->chunk_list=NULL; + png_ptr->num_chunk_list=0; + } #endif + } #ifdef PNG_USER_MEM_SUPPORTED png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, |