Commit 35728e41 authored by Simon Eugster's avatar Simon Eugster
Browse files

Fixed: All scopes were working forever when the input image had size 0

svn path=/trunk/kdenlive/; revision=4713
parent 9391e9a8
...@@ -23,7 +23,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm ...@@ -23,7 +23,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm
const bool &unscaled, const uint &accelFactor) const const bool &unscaled, const uint &accelFactor) const
{ {
qDebug() << "Histogram rect size is: " << paradeSize.width() << "/" << paradeSize.height(); 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(); return QImage();
} }
...@@ -64,7 +64,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm ...@@ -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); 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 // Nothing to draw
return QImage(); return QImage();
} }
......
...@@ -30,7 +30,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm ...@@ -30,7 +30,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
{ {
Q_ASSERT(accelFactor >= 1); 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(); return QImage();
} else { } else {
......
...@@ -90,7 +90,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, ...@@ -90,7 +90,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
const VectorscopeGenerator::PaintMode &paintMode, const bool&, const VectorscopeGenerator::PaintMode &paintMode, const bool&,
const uint &accelFactor) const 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 // Invalid size
return QImage(); return QImage();
} }
......
...@@ -36,7 +36,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm ...@@ -36,7 +36,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
QImage wave(waveformSize, QImage::Format_ARGB32); 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(); return QImage();
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment