mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 12:28:31 +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:
parent
1430cc4114
commit
534f216de2
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user