diff options
| author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2024-12-09 18:04:19 +0100 |
|---|---|---|
| committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2024-12-13 14:13:59 +0000 |
| commit | 0ace5ba0357b1614b47cb38a16f4afb2fe8e62db (patch) | |
| tree | b909faf60a0fac5169a725557bd04575b128b65f /src | |
| parent | 2c0d87149ce1ebaa66b7e6d9bae7b31225547301 (diff) | |
Fix in-place conversion of certain QImage formats
In the copying/transcription of the generic converter to the generic
in-place converter, a test for Format_RGB32 destination format was
mistakenly replaced with test of source format. The result was that a
suboptimal pixel store function was selected, and the resulting image
data could end up with non-0xff in the unused alpha field.
Task-number: QTBUG-132051
Pick-to: 6.9 6.8
Change-Id: If3ebf5fdd7ab6e377c8ad479ea38ce665f922b7c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/gui/image/qimage_conversions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index c1a700fddfb..be1bad22b1b 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -396,7 +396,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im !destLayout->hasAlphaChannel && destLayout->storeFromRGB32) { // Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format. fetch = qPixelLayouts[qt_toPremultipliedFormat(data->format)].fetchToARGB32PM; - if (data->format == QImage::Format_RGB32) + if (dst_format == QImage::Format_RGB32) store = storeRGB32FromARGB32; else store = destLayout->storeFromRGB32; |
