summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qxbmhandler.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-09 09:14:12 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-13 08:17:00 +0000
commitac8a3b948da1980bc59bae3fc76d20b5b45662a0 (patch)
treef08eed7df003491d742190f9eeb5a2fb06518ae5 /src/gui/image/qxbmhandler.cpp
parent9915630d0886434e8984904b1cadedc81dc78ca0 (diff)
QtGui: Use QImage::constBits()/constScanLine() in non-const contexts.
Prevent potential detaching by using constBits()/constScanLine() instead of bits()/scanLine(). Change-Id: If03f8d4d3b8ed4c07aed5eff7f580e57ca771919 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui/image/qxbmhandler.cpp')
-rw-r--r--src/gui/image/qxbmhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 81525d9dd6..44d07f1624 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -210,7 +210,7 @@ static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const
char *p = buf;
int bpl = (w+7)/8;
for (int y = 0; y < h; ++y) {
- uchar *b = image.scanLine(y);
+ const uchar *b = image.constScanLine(y);
for (i = 0; i < bpl; ++i) {
*p++ = '0'; *p++ = 'x';
*p++ = hexrep[*b >> 4];