Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: third_party/libpng/pngrutil.c

Issue 754183005: Define CHROME_PNG_READ_iCCP_sRGB_cHRM_gAMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libpng/png.h ('k') | third_party/libpng/pngusr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libpng/pngrutil.c
diff --git a/third_party/libpng/pngrutil.c b/third_party/libpng/pngrutil.c
index 10588c4e1d0d0b469384cc6e8fef4be05adb18d6..c3afd6cdd1dd4247054b19fa84650ac2d6de9ffa 100644
--- a/third_party/libpng/pngrutil.c
+++ b/third_party/libpng/pngrutil.c
@@ -698,6 +698,11 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Should be an error, but we can cope with it */
png_warning(png_ptr, "Out of place gAMA chunk");
+#ifdef CHROME_PNG_READ_iCCP_sRGB_cHRM_gAMA
+ if (info_ptr != NULL)
+ info_ptr->chroma_or_gamma |= PNG_INFO_gAMA;
+#endif
+
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
#ifdef PNG_READ_sRGB_SUPPORTED
&& !(info_ptr->valid & PNG_INFO_sRGB)
@@ -848,6 +853,11 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Should be an error, but we can cope with it */
png_warning(png_ptr, "Missing PLTE before cHRM");
+#ifdef CHROME_PNG_READ_iCCP_sRGB_cHRM_gAMA
+ if (info_ptr != NULL)
+ info_ptr->chroma_or_gamma |= PNG_INFO_cHRM;
+#endif
+
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)
#ifdef PNG_READ_sRGB_SUPPORTED
&& !(info_ptr->valid & PNG_INFO_sRGB)
« no previous file with comments | « third_party/libpng/png.h ('k') | third_party/libpng/pngusr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698