summaryrefslogtreecommitdiffstats
path: root/third_party/libpng
diff options
context:
space:
mode:
authornoel <noel@chromium.org>2015-12-14 05:40:38 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-14 13:42:00 +0000
commit930edd36004a03860e3db928dd92f2897cf058c1 (patch)
tree3679ecbdc0bb5c15998e66306ad356b47e209d96 /third_party/libpng
parentd6411b9d68f264d598362541e5e71b5bf9794a18 (diff)
downloadchromium_src-930edd36004a03860e3db928dd92f2897cf058c1.zip
chromium_src-930edd36004a03860e3db928dd92f2897cf058c1.tar.gz
chromium_src-930edd36004a03860e3db928dd92f2897cf058c1.tar.bz2
Stop large iCCP chunks causing delays and "Aw Snap!"
Configure PNG chunk user limits. With the limits in place, the examples on the bug [1] no longer "Aw Snap!" the tab. [1] https://crbug.com/117369#c12 BUG=117369 Review URL: https://codereview.chromium.org/1524683002 Cr-Commit-Position: refs/heads/master@{#365018}
Diffstat (limited to 'third_party/libpng')
-rw-r--r--third_party/libpng/README.chromium1
-rw-r--r--third_party/libpng/pngusr.h9
2 files changed, 8 insertions, 2 deletions
diff --git a/third_party/libpng/README.chromium b/third_party/libpng/README.chromium
index 2ac5615..80860bd 100644
--- a/third_party/libpng/README.chromium
+++ b/third_party/libpng/README.chromium
@@ -15,3 +15,4 @@ stripped.
- Unset PNG_NO_READ_PACK on Android in pngusr.h, required by freetype to support
color glyphs.
+- Configure PNG chunk user limits (crbug.com/117369)
diff --git a/third_party/libpng/pngusr.h b/third_party/libpng/pngusr.h
index fabae6e..39cdb59 100644
--- a/third_party/libpng/pngusr.h
+++ b/third_party/libpng/pngusr.h
@@ -116,8 +116,13 @@
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#undef PNG_NO_EASY_ACCESS
-#define PNG_NO_USER_LIMITS
-#define PNG_NO_SET_USER_LIMITS
+
+/* Set recommended chunk limits: see https://crbug.com/117369 */
+#undef PNG_NO_USER_LIMITS
+#undef PNG_NO_SET_USER_LIMITS
+#define PNG_USER_CHUNK_CACHE_MAX 128
+#define PNG_USER_CHUNK_MALLOC_MAX 4000000L
+
#define PNG_NO_TIME_RFC1123
#undef PNG_NO_INFO_IMAGE
#undef PNG_NO_PROGRESSIVE_READ