From 534f216de24973cae2b92fd1e89ea97aaf482521 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 18 Aug 2013 13:05:12 +1000 Subject: [PATCH] Ensure we don't read past the end of the color vector when rendering a moodbar. Fixes issue 3811. --- src/moodbar/moodbarrenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/moodbar/moodbarrenderer.cpp b/src/moodbar/moodbarrenderer.cpp index ab3846ff8..fa00f5b87 100644 --- a/src/moodbar/moodbarrenderer.cpp +++ b/src/moodbar/moodbarrenderer.cpp @@ -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