From 35f2e1768b9cb2da5cedc6f0c1c2d88a6ce27bb0 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 10 Mar 2012 19:42:03 -0600 Subject: [PATCH] [libpng16] In pngtest, treat benign errors as errors if "-strict" is present. --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- pngtest.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index abc870d72..1c9ee73a8 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.6.0beta18 - March 10, 2012 +Libpng 1.6.0beta18 - March 11, 2012 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. @@ -298,8 +298,9 @@ Version 1.6.0beta17 [March 10, 2012] chunks could end up with a too-small windowBits value in the deflate header. -Version 1.6.0beta18 [March 10, 2012] +Version 1.6.0beta18 [March 11, 2012] Issue a png_benign_error() instead of png_warning() about bad palette index. + In pngtest, treat benign errors as errors if "-strict" is present. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 2fe5123d7..29be270be 100644 --- a/CHANGES +++ b/CHANGES @@ -4049,8 +4049,9 @@ Version 1.6.0beta17 [March 10, 2012] chunks could end up with a too-small windowBits value in the deflate header. -Version 1.6.0beta18 [March 10, 2012] +Version 1.6.0beta18 [March 11, 2012] Issue a png_benign_error() instead of png_warning() about bad palette index. + In pngtest, treat benign errors as errors if "-strict" is present. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngtest.c b/pngtest.c index 78c275be8..5b1da5622 100644 --- a/pngtest.c +++ b/pngtest.c @@ -745,6 +745,17 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) #endif #endif + if (strict) + { + /* Treat png_benign_error() as errors on read */ + png_set_benign_errors(read_ptr, 0); + + /* Treat them as errors on write */ + png_set_benign_errors(write_ptr, 0); + + /* if strict is not set, then both are treated as warnings. */ + } + pngtest_debug("Initializing input and output streams"); #ifdef PNG_STDIO_SUPPORTED png_init_io(read_ptr, fpin); -- GitLab