src/gui/image/qpixmapfilter.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 22 79de32ba3296
--- a/src/gui/image/qpixmapfilter.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/gui/image/qpixmapfilter.cpp	Mon May 03 13:17:34 2010 +0300
@@ -777,6 +777,9 @@
 
 Q_GUI_EXPORT QImage qt_halfScaled(const QImage &source)
 {
+    if (source.width() < 2 || source.height() < 2)
+        return QImage();
+
     QImage srcImage = source;
 
     if (source.format() == QImage::Format_Indexed8) {
@@ -869,7 +872,7 @@
     }
 
     qreal scale = 1;
-    if (radius >= 4) {
+    if (radius >= 4 && blurImage.width() >= 2 && blurImage.height() >= 2) {
         blurImage = qt_halfScaled(blurImage);
         scale = 2;
         radius *= qreal(0.5);