1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 20:34:39 +01:00

Ensure we don't read past the end of the color vector when rendering a moodbar.

Fixes issue 3811.
This commit is contained in:
David Sansome 2013-08-18 13:05:12 +10:00
parent 1430cc4114
commit 534f216de2

View File

@ -108,7 +108,7 @@ void MoodbarRenderer::Render(const ColorVector& colors, QPainter* p, const QRect
uint end = (x + 1) * colors.size() / rect.width();
if (start == end)
end = start + 1;
end = qMin(start + 1, colors.size() - 1);
for (uint j=start; j<end; j++) {
r += colors[j].red();