]> git.sesse.net Git - kdenlive/commitdiff
Fixed: All scopes were working forever when the input image had size 0
authorSimon A. Eugster <simon.eu@gmail.com>
Fri, 13 Aug 2010 15:02:24 +0000 (15:02 +0000)
committerSimon A. Eugster <simon.eu@gmail.com>
Fri, 13 Aug 2010 15:02:24 +0000 (15:02 +0000)
svn path=/trunk/kdenlive/; revision=4713

src/colorcorrection/histogramgenerator.cpp
src/colorcorrection/rgbparadegenerator.cpp
src/colorcorrection/vectorscopegenerator.cpp
src/colorcorrection/waveformgenerator.cpp

index 3c3308efe1914f403cf02b7a3fb96c5c3ac8a929..75f2d4a6bf7c10a09b33c8d55d87f0e22afab417 100644 (file)
@@ -23,7 +23,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm
                                         const bool &unscaled, const uint &accelFactor) const
 {
     qDebug() << "Histogram rect size is: " << paradeSize.width() << "/" << paradeSize.height();
-    if (paradeSize.height() <= 0 || paradeSize.width() <= 0) {
+    if (paradeSize.height() <= 0 || paradeSize.width() <= 0 || image.width() <= 0 || image.height() <= 0) {
         return QImage();
     }
 
@@ -64,7 +64,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm
 
 
     const int nParts = (drawY ? 1 : 0) + (drawR ? 1 : 0) + (drawG ? 1 : 0) + (drawB ? 1 : 0);
-    if (nParts == 0 || byteCount == 0) {
+    if (nParts == 0) {
         // Nothing to draw
         return QImage();
     }
index c79a81714520f8287100fb2af5a832db4e2b0679..ff1e196e43bfee926383e4dbf3800b6c5d35c697 100644 (file)
@@ -30,7 +30,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
 {
     Q_ASSERT(accelFactor >= 1);
 
-    if (paradeSize.width() <= 0 || paradeSize.height() <= 0) {
+    if (paradeSize.width() <= 0 || paradeSize.height() <= 0 || image.width() <= 0 || image.height() <= 0) {
         return QImage();
 
     } else {
index 6536a817d02f6c46bed988ab016a452013d00dfd..15e42db01d02ebee27712e45e73a2b3566594fc3 100644 (file)
@@ -90,7 +90,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
                                                   const VectorscopeGenerator::PaintMode &paintMode, const bool&,
                                                   const uint &accelFactor) const
 {
-    if (vectorscopeSize.width() <= 0 || vectorscopeSize.height() <= 0) {
+    if (vectorscopeSize.width() <= 0 || vectorscopeSize.height() <= 0 || image.width() <= 0 || image.height() <= 0) {
         // Invalid size
         return QImage();
     }
index 3da947733564ecbbc959af9333dd689b12a31e6b..633a2211135326eb99ea398a0acfeb234f0ebcf2 100644 (file)
@@ -36,7 +36,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
 
     QImage wave(waveformSize, QImage::Format_ARGB32);
 
-    if (waveformSize.width() <= 0 || waveformSize.height() <= 0) {
+    if (waveformSize.width() <= 0 || waveformSize.height() <= 0 || image.width() <= 0 || image.height() <= 0) {
         return QImage();
 
     } else {