diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 6b8136c52d..207e31d91a 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3653,8 +3653,9 @@ QImage::Format QRasterBuffer::prepare(QImage *image) drawHelper = qDrawHelper + format; if (image->depth() == 1 && image->colorTable().size() == 2) { monoDestinationWithClut = true; - destColor0 = qPremultiply(image->colorTable()[0]); - destColor1 = qPremultiply(image->colorTable()[1]); + const QVector colorTable = image->colorTable(); + destColor0 = qPremultiply(colorTable[0]); + destColor1 = qPremultiply(colorTable[1]); } return format;