diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2008-01-21 21:07:36 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2009-04-06 16:15:58 -0500 |
commit | 49f304bd07b9b53c63aad8bf2d6a8f1e5c400087 (patch) | |
tree | d88dda2ad24672d9f03e18a005a48841f339440e /pngread.c | |
parent | c95be422219648df3fcdab480a54e171791758b2 (diff) | |
download | libpng-49f304bd07b9b53c63aad8bf2d6a8f1e5c400087.tar.gz |
Imported from libpng-1.2.25beta03.tarv1.2.25beta03
Diffstat (limited to 'pngread.c')
-rw-r--r-- | pngread.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -1,9 +1,9 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.2.24 [December 14, 2007] + * Last changed in libpng 1.2.25 [January 22, 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.) * @@ -89,12 +89,18 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, 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]) + i=0; + do + { + if(user_png_ver[i] != png_libpng_ver[i]) + png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; + } while (png_libpng_ver[i++]); + } + else png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); + if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) { @@ -318,7 +324,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, void PNGAPI png_read_info(png_structp png_ptr, png_infop info_ptr) { - if(png_ptr == NULL) return; + if(png_ptr == NULL || info_ptr == NULL) return; png_debug(1, "in png_read_info\n"); /* If we haven't checked all of the PNG signature bytes, do so now. */ if (png_ptr->sig_bytes < 8) @@ -1112,6 +1118,8 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, mem_ptr = png_ptr->mem_ptr; #endif } + else + return; if (info_ptr_ptr != NULL) info_ptr = *info_ptr_ptr; |