[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.
diff --git a/png.c b/png.c
index a894ac5..330fc2b 100644
--- a/png.c
+++ b/png.c
@@ -768,13 +768,13 @@
#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_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;
}