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

Unified Diff: chrome/browser/views/download_tab_view.cc

Issue 14806: Fixes crash in download tab view that resulted from attempting to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/download_tab_view.cc
===================================================================
--- chrome/browser/views/download_tab_view.cc (revision 7147)
+++ chrome/browser/views/download_tab_view.cc (working copy)
@@ -877,7 +877,10 @@
if (canvas->getClipBounds(&clip)) {
int row_start = (SkScalarRound(clip.fTop) - kSpacer) /
(big_icon_size_ + kSpacer);
- int row_stop = SkScalarRound(clip.fBottom) / (big_icon_size_ + kSpacer);
+ int row_stop =
+ std::min(static_cast<int>(downloads_.size()) - 1,
+ (SkScalarRound(clip.fBottom) - kSpacer) /
+ (big_icon_size_ + kSpacer));
SkRect download_rect;
for (int i = row_start; i <= row_stop; ++i) {
int y = i * (big_icon_size_ + kSpacer) + kSpacer;
« 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