diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-09 16:54:41 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-09 19:47:30 +0200 |
commit | 1c5da7207a21cc44a4a08d291c290ffcd9b958fd (patch) | |
tree | 20041e6e1b8482a38dae3e7e58ad5c5ca0bdf125 /src/gui/image/qimage.cpp | |
parent | bae78d4a2cc32952a19e4da9f0486af635ea6d47 (diff) |
Prevent crash in OpenGL engine when scaling images / pixmaps.
Make sure the resulting image / pixmap is valid if the source was valid.
Task-number: QTBUG-19157
Reviewed-by: Kim
Reviewed-by: Benjamin Poulain
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 441bdb1a4a..c86798440f 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4377,6 +4377,8 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf QSize newSize = size(); newSize.scale(s, aspectMode); + newSize.rwidth() = qMax(newSize.width(), 1); + newSize.rheight() = qMax(newSize.height(), 1); if (newSize == size()) return *this; |