Fix #7434: Incorrect use of vector iterator. (#7437)

This commit is contained in:
PeterN 2019-03-29 17:42:32 +00:00 committed by GitHub
parent acb09eb9a8
commit 9244dad3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -636,9 +636,8 @@ public:
uint y = r.top;
auto iter = this->content.begin() + this->vscroll->GetPosition();
auto end = iter + this->vscroll->GetCapacity();
if (end > this->content.end())
end = this->content.end();
size_t last = this->vscroll->GetPosition() + this->vscroll->GetCapacity();
auto end = (last < this->content.size()) ? this->content.begin() + last : this->content.end();
for (/**/; iter != end; iter++) {
const ContentInfo *ci = *iter;