From e3ae5835144df7a3b1bba00d51820eb70973dd12 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 22 Feb 2014 22:22:15 -0600 Subject: [PATCH] [libpng16] Don't recognize known sRGB profiles as sRGB if they have been hacked. --- ANNOUNCE | 1 + CHANGES | 1 + png.c | 21 ++++++++++----------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index ddccdc090..b8bd1a492 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -79,6 +79,7 @@ Version 1.6.10beta02 [February 23, 2014] Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk after recognizing the IDAT chunk, which avoids an infinite loop while reading a datastream whose first IDAT chunk is of zero-length. + Don't recognize known sRGB profiles as sRGB if they have been hacked. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index bf84027e5..85b26b719 100644 --- a/CHANGES +++ b/CHANGES @@ -4853,6 +4853,7 @@ Version 1.6.10beta02 [February 23, 2014] Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk after recognizing the IDAT chunk, which avoids an infinite loop while reading a datastream whose first IDAT chunk is of zero-length. + Don't recognize known sRGB profiles as sRGB if they have been hacked. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.c b/png.c index cc6e6eeb8..f06c6c272 100644 --- a/png.c +++ b/png.c @@ -773,13 +773,13 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.10beta02 - February 9, 2014" PNG_STRING_NEWLINE \ + "libpng version 1.6.10beta02 - February 23, 2014" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.10beta02 - February 9, 2014\ + return "libpng version 1.6.10beta02 - February 23, 2014\ Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -2295,15 +2295,14 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, } } -# if PNG_sRGB_PROFILE_CHECKS > 0 - /* The signature matched, but the profile had been changed in some - * way. This is an apparent violation of the ICC terms of use and, - * anyway, probably indicates a data error or uninformed hacking. - */ - if (png_sRGB_checks[i].have_md5) - png_benign_error(png_ptr, - "copyright violation: edited ICC profile ignored"); -# endif + /* The signature matched, but the profile had been changed in some + * way. This probably indicates a data error or uninformed hacking. + * Fall through to "no match". + */ + png_chunk_report(png_ptr, + "Not recognizing known sRGB profile that has been edited", + PNG_CHUNK_WARNING); + break; } }