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

Unified Diff: chrome/browser/ui/webui/favicon_source.cc

Issue 11576030: Add size checks to extension icons to prevent out of memory conditions (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « chrome/browser/ui/webui/extensions/extension_icon_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/favicon_source.cc
===================================================================
--- chrome/browser/ui/webui/favicon_source.cc (revision 173105)
+++ chrome/browser/ui/webui/favicon_source.cc (working copy)
@@ -82,8 +82,10 @@
size_t scale_delimiter = path.find("@", 5);
std::string size = path.substr(5, slash - 5);
size_in_dip = atoi(size.c_str());
- DCHECK(size_in_dip == 64 || size_in_dip == 32 || size_in_dip == 16) <<
- "only 64x64, 32x32 and 16x16 icons are supported";
+ if (size_in_dip != 64 && size_in_dip != 32 && size_in_dip != 16) {
+ // Only 64x64, 32x32 and 16x16 icons are supported.
+ size_in_dip = 16;
+ }
// Optional scale factor.
if (scale_delimiter != std::string::npos && scale_delimiter < slash) {
DCHECK(size_in_dip == 16);
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_icon_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698