From ac8a3b948da1980bc59bae3fc76d20b5b45662a0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 9 Feb 2016 09:14:12 +0100 Subject: 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 Reviewed-by: Marc Mutz --- src/gui/image/qppmhandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/image/qppmhandler.cpp') diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp index 7f23656c02..6eb35e1558 100644 --- a/src/gui/image/qppmhandler.cpp +++ b/src/gui/image/qppmhandler.cpp @@ -329,7 +329,7 @@ static bool write_pbm_image(QIODevice *out, const QImage &sourceImage, const QBy if (image.format() == QImage::Format_Indexed8) { QVector color = image.colorTable(); for (uint y=0; y(image.constScanLine(y)); uchar *p = buf; uchar *end = buf+bpl; while (p < end) { -- cgit v1.2.3