From 2522de85940a988c0da1d793bfb9d2aeb11d1838 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 8 Nov 2009 20:07:41 -0600 Subject: [PATCH] [master] Restore new pngtest.c --- ANNOUNCE | 4 ++-- CHANGES | 13 ++----------- pngtest.c | 6 +++--- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 68d2c7d72..3de0a2ac0 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -137,10 +137,10 @@ version 1.2.41beta15 [November 8, 2009] functions while building libpng. They need to be tested, especially those using compilers other than gcc. 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] + 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 diff --git a/CHANGES b/CHANGES index 49a665342..6e942a309 100644 --- a/CHANGES +++ b/CHANGES @@ -2568,20 +2568,11 @@ version 1.2.41beta15 [November 8, 2009] functions while building libpng. They need to be tested, especially those using compilers other than gcc. 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 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 (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/pngtest.c b/pngtest.c index cd75f87db..87c9cc37b 100644 --- a/pngtest.c +++ b/pngtest.c @@ -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, &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 */ - if (!((read_info_ptr->color_type == PNG_COLOR_TYPE_GRAY && + if (!((color_type == PNG_COLOR_TYPE_GRAY && (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->green > sample_max || (int)trans_values->blue > sample_max))))