summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2012-06-20 11:45:32 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-06-25 13:05:25 (GMT)
commit38726b19c0d89b135c1f92d931f64532f48e4597 (patch)
treeaccd5b498483463c3105d97390a687b8858e575c /src
parent90b71dc0ff4ec9bb150a0de9933d6eb06d995a34 (diff)
downloadQt-38726b19c0d89b135c1f92d931f64532f48e4597.zip
Qt-38726b19c0d89b135c1f92d931f64532f48e4597.tar.gz
Qt-38726b19c0d89b135c1f92d931f64532f48e4597.tar.bz2
Fix possible crash when copying QImage.
Task-number: QTBUG-14766 Change-Id: I0b9ec19ea43355e04a12f2dc0244b22b575fab44 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index f8f81e9..24650ba 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -1400,7 +1400,7 @@ QImage QImage::copy(const QRect& r) const
// Qt for Embedded Linux can create images with non-default bpl
// make sure we don't crash.
if (image.d->nbytes != d->nbytes) {
- int bpl = image.bytesPerLine();
+ int bpl = qMin(bytesPerLine(), image.bytesPerLine());
for (int i = 0; i < height(); i++)
memcpy(image.scanLine(i), scanLine(i), bpl);
} else