From 64c61b85ecc24a1caed44a63de3819bb8411baa7 Mon Sep 17 00:00:00 2001 From: "Simon A. Eugster" Date: Mon, 9 Aug 2010 13:35:11 +0000 Subject: [PATCH] Fixed: When the Histogram was visible when loading a project, it received a 0x0 image, leading to a nearly infinity loop. svn path=/trunk/kdenlive/; revision=4692 --- src/colorcorrection/histogramgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/colorcorrection/histogramgenerator.cpp b/src/colorcorrection/histogramgenerator.cpp index 0eed257b..3c3308ef 100644 --- a/src/colorcorrection/histogramgenerator.cpp +++ b/src/colorcorrection/histogramgenerator.cpp @@ -64,7 +64,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm const int nParts = (drawY ? 1 : 0) + (drawR ? 1 : 0) + (drawG ? 1 : 0) + (drawB ? 1 : 0); - if (nParts == 0) { + if (nParts == 0 || byteCount == 0) { // Nothing to draw return QImage(); } @@ -115,6 +115,7 @@ QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const { QImage component(256, size.height(), QImage::Format_ARGB32); component.fill(qRgba(0, 0, 0, 0)); + Q_ASSERT(scaling != INFINITY); const int partH = size.height(); int partY; -- 2.39.2