[libpng17] Don't recognize known sRGB profiles as sRGB if they have been hacked,

but don't reject them and don't issue a copyright violation warning.
This commit is contained in:
Glenn Randers-Pehrson
2014-02-26 11:52:00 -06:00
parent 148cdac18f
commit deb920b4a7

15
png.c
View File

@@ -696,13 +696,13 @@ png_get_copyright(png_const_structrp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.7.0beta32 - February 6, 2014" PNG_STRING_NEWLINE \ "libpng version 1.7.0beta32 - February 26, 2014" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.7.0beta32 - February 6, 2014\ return "libpng version 1.7.0beta32 - February 26, 2014\
Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1998-2014 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -2205,12 +2205,13 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
# if PNG_sRGB_PROFILE_CHECKS > 0 # if PNG_sRGB_PROFILE_CHECKS > 0
/* The signature matched, but the profile had been changed in some /* The signature matched, but the profile had been changed in some
* way. This is an apparent violation of the ICC terms of use and, * way. This probably indicates a data error or uninformed hacking.
* anyway, probably indicates a data error or uninformed hacking. * Fall through to "no match".
*/ */
if (png_sRGB_checks[i].have_md5) png_chunk_report(png_ptr,
png_benign_error(png_ptr, "Not recognizing known sRGB profile that has been edited",
"copyright violation: edited ICC profile ignored"); PNG_CHUNK_WARNING);
break;
# endif # endif
} }
} }