summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2012-06-20 13:45:32 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-25 15:05:25 +0200
commit38726b19c0d89b135c1f92d931f64532f48e4597 (patch)
treeaccd5b498483463c3105d97390a687b8858e575c /src/gui
parent90b71dc0ff4ec9bb150a0de9933d6eb06d995a34 (diff)
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/gui')
-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 f8f81e9c0a..24650ba1bf 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