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

Unified Diff: ui/gfx/color_utils.cc

Issue 7064024: Check for no pixels after calling lockPixels(). If so, we return rather than (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_utils.cc
===================================================================
--- ui/gfx/color_utils.cc (revision 86420)
+++ ui/gfx/color_utils.cc (working copy)
@@ -208,6 +208,9 @@
SkAutoLockPixels favicon_lock(*favicon);
SkColor* pixels = static_cast<SkColor*>(favicon->getPixels());
+ if (!pixels)
+ return SkColorSetARGB(alpha, 0, 0, 0);
+
// Assume ARGB_8888 format.
DCHECK(favicon->getConfig() == SkBitmap::kARGB_8888_Config);
SkColor* current_color = pixels;
@@ -241,6 +244,9 @@
void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]) {
SkAutoLockPixels bitmap_lock(*bitmap);
+ if (!bitmap->getPixels())
+ return;
+
// Assume ARGB_8888 format.
DCHECK(bitmap->getConfig() == SkBitmap::kARGB_8888_Config);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698