提交 9c5a1bae 编写于 作者: G Glenn Randers-Pehrson

[libpng16] 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.
上级 37b7299b
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
......
......@@ -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
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册