]> git.sesse.net Git - kdenlive/commitdiff
Vectorscope Generator: Check for valid size before calculating anything
authorSimon A. Eugster <simon.eu@gmail.com>
Fri, 23 Jul 2010 12:34:04 +0000 (12:34 +0000)
committerSimon A. Eugster <simon.eu@gmail.com>
Fri, 23 Jul 2010 12:34:04 +0000 (12:34 +0000)
svn path=/trunk/kdenlive/; revision=4633

src/colorcorrection/vectorscopegenerator.cpp

index ad6164978f39e0df6c13abbab2b8611b029b83c3..6536a817d02f6c46bed988ab016a452013d00dfd 100644 (file)
@@ -90,6 +90,11 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize,
                                                   const VectorscopeGenerator::PaintMode &paintMode, const bool&,
                                                   const uint &accelFactor) const
 {
+    if (vectorscopeSize.width() <= 0 || vectorscopeSize.height() <= 0) {
+        // Invalid size
+        return QImage();
+    }
+
     // Prepare the vectorscope data
     const int cw = (vectorscopeSize.width() < vectorscopeSize.height()) ? vectorscopeSize.width() : vectorscopeSize.height();
     QImage scope = QImage(cw, cw, QImage::Format_ARGB32);