[master] Restore new pngtest.c

This commit is contained in:
Glenn Randers-Pehrson 2009-11-08 20:07:41 -06:00
parent e5e60564cf
commit 2522de8594
3 changed files with 7 additions and 16 deletions

View File

@ -137,10 +137,10 @@ version 1.2.41beta15 [November 8, 2009]
functions while building libpng. They need to be tested, especially functions while building libpng. They need to be tested, especially
those using compilers other than gcc. those using compilers other than gcc.
Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG". Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
Removed three direct references to read_info_ptr members in pngtest.c
that were detected by the new PNG_DEPSTRUCT macro.
version 1.2.41beta16 [November 9, 2009] version 1.2.41beta16 [November 9, 2009]
Removed three direct references to read_info_ptr members in pngtest.c
that were detected by the new PNG_DEPSTRUCT macro.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net

13
CHANGES
View File

@ -2568,20 +2568,11 @@ version 1.2.41beta15 [November 8, 2009]
functions while building libpng. They need to be tested, especially functions while building libpng. They need to be tested, especially
those using compilers other than gcc. those using compilers other than gcc.
Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG". Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
version 1.2.41beta16 [November 9, 2009]
Removed three direct references to read_info_ptr members in pngtest.c Removed three direct references to read_info_ptr members in pngtest.c
that were detected by the new PNG_DEPSTRUCT macro. that were detected by the new PNG_DEPSTRUCT macro.
version 1.2.41beta16 [November 9, 2009]
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P
*/
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@ -1112,11 +1112,11 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans,
&trans_values)) &trans_values))
{ {
int sample_max = (1 << read_info_ptr->bit_depth); int sample_max = (1 << bit_depth);
/* libpng doesn't reject a tRNS chunk with out-of-range samples */ /* libpng doesn't reject a tRNS chunk with out-of-range samples */
if (!((read_info_ptr->color_type == PNG_COLOR_TYPE_GRAY && if (!((color_type == PNG_COLOR_TYPE_GRAY &&
(int)trans_values->gray > sample_max) || (int)trans_values->gray > sample_max) ||
(read_info_ptr->color_type == PNG_COLOR_TYPE_RGB && (color_type == PNG_COLOR_TYPE_RGB &&
((int)trans_values->red > sample_max || ((int)trans_values->red > sample_max ||
(int)trans_values->green > sample_max || (int)trans_values->green > sample_max ||
(int)trans_values->blue > sample_max)))) (int)trans_values->blue > sample_max))))