diff options
Diffstat (limited to 'src/libpng/pngrutil.c')
-rw-r--r-- | src/libpng/pngrutil.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libpng/pngrutil.c b/src/libpng/pngrutil.c index ae1e3f7..f656dfb 100644 --- a/src/libpng/pngrutil.c +++ b/src/libpng/pngrutil.c @@ -1,12 +1,15 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h + * Last changed in libpng 1.2.38 [July 16, 2009] * Copyright (c) 1998-2009 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.) * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * * This file contains routines that are only called from within * libpng itself during the course of reading an image. */ @@ -2251,7 +2254,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (!(png_ptr->chunk_name[0] & 0x20)) { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) +#if defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != PNG_HANDLE_CHUNK_ALWAYS #if defined(PNG_READ_USER_CHUNKS_SUPPORTED) @@ -2263,8 +2266,11 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) || - (png_ptr->read_user_chunk_fn != NULL)) + if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) + || (png_ptr->read_user_chunk_fn != NULL) +#endif + ) { #ifdef PNG_MAX_MALLOC_64K if (length > (png_uint_32)65535L) @@ -2275,7 +2281,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #endif png_memcpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, + (png_charp)png_ptr->chunk_name, png_sizeof(png_ptr->unknown_chunk.name)); png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] = '\0'; png_ptr->unknown_chunk.size = (png_size_t)length; @@ -2298,8 +2304,10 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (ret == 0) { if (!(png_ptr->chunk_name[0] & 0x20)) +#if defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != PNG_HANDLE_CHUNK_ALWAYS) +#endif png_chunk_error(png_ptr, "unknown critical chunk"); png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); |