[libpng16] Disallow storing sRGB information when the sRGB is not supported.

Reverted previous attempt to allow gAMA and sRGB non-support with the
simplified API.
This commit is contained in:
John Bowler
2013-04-17 21:27:47 -05:00
committed by Glenn Randers-Pehrson
parent 7fdb594e73
commit e4413a735b
8 changed files with 159 additions and 40 deletions

9
png.c
View File

@@ -768,13 +768,13 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.6.2beta02 - April 14, 2013" PNG_STRING_NEWLINE \
"libpng version 1.6.2beta02 - April 18, 2013" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2013 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.2beta02 - April 14, 2013\
return "libpng version 1.6.2beta02 - April 18, 2013\
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -2275,7 +2275,10 @@ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
profile))
{
png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
# ifdef PNG_sRGB_SUPPORTED
/* If no sRGB support, don't try storing sRGB information */
png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
# endif
return 1;
}