Fix divide by zero error in MoodbarRenderer. Fixes issue 3823.

This commit is contained in:
Andreas 2013-08-24 21:07:44 +02:00
parent 5fc6804326
commit bd528a47cd
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ void MoodbarRenderer::Render(const ColorVector& colors, QPainter* p, const QRect
b += colors[j].blue();
}
const int n = end - start;
const int n = qMax(1, end - start);
screen_colors.append(QColor(r/n, g/n, b/n));
}