Commit fc185a85 authored by warx's avatar warx Committed by Commit Bot

cros: Fix wallpaper manager indexing vector out-of-range issue

BUG=none
TBR=xdai@chromium.org
TEST=chrome doesn't crash

Review-Url: https://codereview.chromium.org/2954563002
Cr-Commit-Position: refs/heads/master@{#481703}
parent e530921f
...@@ -950,7 +950,7 @@ void WallpaperManager::OnWindowDestroying(aura::Window* window) { ...@@ -950,7 +950,7 @@ void WallpaperManager::OnWindowDestroying(aura::Window* window) {
void WallpaperManager::OnColorCalculationComplete() { void WallpaperManager::OnColorCalculationComplete() {
size_t num_of_calculation = color_calculator_->prominent_colors().size(); size_t num_of_calculation = color_calculator_->prominent_colors().size();
DCHECK_EQ(1u, num_of_calculation); DCHECK_EQ(1u, num_of_calculation);
SkColor color = color_calculator_->prominent_colors()[num_of_calculation]; SkColor color = color_calculator_->prominent_colors()[num_of_calculation - 1];
color_calculator_->RemoveObserver(this); color_calculator_->RemoveObserver(this);
color_calculator_.reset(); color_calculator_.reset();
if (prominent_color_ == color) if (prominent_color_ == color)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment