summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2010-01-08 09:57:43 (GMT)
committergunnar <gunnar@trolltech.com>2010-01-08 09:59:19 (GMT)
commit1484008e831a6b18272babb17992c4de686da045 (patch)
tree2579feb9a218fd7f042456693197729bbbe20502 /src
parent785767e1f965a904765bab5dbfff1a21240dcc88 (diff)
downloadQt-1484008e831a6b18272babb17992c4de686da045.zip
Qt-1484008e831a6b18272babb17992c4de686da045.tar.gz
Qt-1484008e831a6b18272babb17992c4de686da045.tar.bz2
Make sure the rect in QPixmap::copy() doesn't exceed the boundingRect.
Task: http://bugreports.qt.nokia.com/browse/QTBUG-6303 Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 7e4597e..7b522f5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -357,7 +357,9 @@ QPixmap QPixmap::copy(const QRect &rect) const
if (isNull())
return QPixmap();
- const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect;
+ QRect r(0, 0, width(), height());
+ if (!rect.isEmpty())
+ r = r.intersected(rect);
QPixmapData *d = data->createCompatiblePixmapData();
d->copy(data.data(), r);