Imported from libpng-1.2.27beta01.tar

This commit is contained in:
Glenn Randers-Pehrson
2008-04-12 06:59:47 -05:00
parent b8c4b82d18
commit d9d2a6f6d9
51 changed files with 281 additions and 167 deletions

View File

@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
* Last changed in libpng 1.2.26 [April 2, 2008]
* Last changed in libpng 1.2.27 [April 12, 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)
@@ -1502,9 +1502,14 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
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.data = (png_bytep)png_malloc(png_ptr, length);
png_ptr->unknown_chunk.size = (png_size_t)length;
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
if (length == 0)
png_ptr->unknown_chunk.data = NULL;
else
{
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length);
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
}
#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
if(png_ptr->read_user_chunk_fn != NULL)
{
@@ -1527,8 +1532,11 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
else
#endif
png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1);
png_free(png_ptr, png_ptr->unknown_chunk.data);
png_ptr->unknown_chunk.data = NULL;
if (png_ptr->unknown_chunk.data)
{
png_free(png_ptr, png_ptr->unknown_chunk.data);
png_ptr->unknown_chunk.data = NULL;
}
}
else
#endif