projects
/
profile
/
ivi
/
qtbase.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f717c19
)
Fix possible crash when copying QImage.
author
Kim Motoyoshi Kalland
<kim.kalland@nokia.com>
Wed, 20 Jun 2012 11:45:32 +0000
(13:45 +0200)
committer
Qt by Nokia
<qt-info@nokia.com>
Thu, 21 Jun 2012 10:50:08 +0000
(12:50 +0200)
Task-number: QTBUG-14766
Change-Id: I82a4736dbd5ac08ede1b2bdccfa29a2009ebb4d8
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/gui/image/qimage.cpp
patch
|
blob
|
history
diff --git
a/src/gui/image/qimage.cpp
b/src/gui/image/qimage.cpp
index
91af774
..
0b33010
100644
(file)
--- a/
src/gui/image/qimage.cpp
+++ b/
src/gui/image/qimage.cpp
@@
-1117,7
+1117,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