diff --git a/ANNOUNCE b/ANNOUNCE index 7019dcdb2..c4ffef07f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.6.10beta02 - February 16, 2014 +Libpng 1.6.10beta02 - February 17, 2014 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -55,7 +55,7 @@ Version 1.6.10beta01 [February 9, 2014] and it adds corresponding code to pngimage.c to handle such options by not attempting to test them. -Version 1.6.10beta02 [February 16, 2014] +Version 1.6.10beta02 [February 17, 2014] Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng-calling applications. @@ -66,6 +66,10 @@ Version 1.6.10beta02 [February 16, 2014] compile and link on Android by using /proc/cpuinfo, and the old linux code is in contrib/arm-neon/linux-auxv.c. The new code avoids POSIX and Linux dependencies apart from opening /proc/cpuinfo and is C90 compliant. + Check for info_ptr == NULL early in png_read_end() so we don't need to + run all the png_handle_*() and depend on them to return if info_ptr == NULL. + This improves the performance of png_read_end(png_ptr, NULL) and makes + it more robust against future programming errors. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 3b9dd6ad4..3d1fa89f5 100644 --- a/CHANGES +++ b/CHANGES @@ -4829,7 +4829,7 @@ Version 1.6.10beta01 [February 9, 2014] and it adds corresponding code to pngimage.c to handle such options by not attempting to test them. -Version 1.6.10beta02 [February 16, 2014] +Version 1.6.10beta02 [February 17, 2014] Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng-calling applications. @@ -4840,6 +4840,10 @@ Version 1.6.10beta02 [February 16, 2014] compile and link on Android by using /proc/cpuinfo, and the old linux code is in contrib/arm-neon/linux-auxv.c. The new code avoids POSIX and Linux dependencies apart from opening /proc/cpuinfo and is C90 compliant. + Check for info_ptr == NULL early in png_read_end() so we don't need to + run all the png_handle_*() and depend on them to return if info_ptr == NULL. + This improves the performance of png_read_end(png_ptr, NULL) and makes + it more robust against future programming errors. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngread.c b/pngread.c index 25a04f866..e459ed6cb 100644 --- a/pngread.c +++ b/pngread.c @@ -781,11 +781,14 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) png_uint_32 length = png_read_chunk_header(png_ptr); png_uint_32 chunk_name = png_ptr->chunk_name; - if (chunk_name == png_IHDR) + if (chunk_name == png_IEND) + png_handle_IEND(png_ptr, info_ptr, length); + + else if (chunk_name == png_IHDR) png_handle_IHDR(png_ptr, info_ptr, length); - else if (chunk_name == png_IEND) - png_handle_IEND(png_ptr, info_ptr, length); + else if (info_ptr == NULL) + png_crc_finish(png_ptr, length); #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) diff --git a/pngrutil.c b/pngrutil.c index 1a223f644..73d6c0b1c 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1436,7 +1436,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) (sizeof local_buffer), &length, profile + (sizeof profile_header), &size, 0); - /* Still expect a a buffer error because we expect + /* Still expect a buffer error because we expect * there to be some tag data! */ if (size == 0)