diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-12-23 15:52:22 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2023-01-05 20:09:20 +0100 |
commit | 7eccd7ac1c98e0c15c0b4a13d036a5ef46896d8a (patch) | |
tree | ec0d8a72ecaeee5781d7fdc14ee51cf2efbbafe7 /src/gui/image/qimage_neon.cpp | |
parent | 2ed4e5d37dabec3859c2afc2037eeb7baf183789 (diff) |
Fix potential corruption with image format conversion on arm neon
For tiny scanline lengths, even the initial offset to align on 16
bytes may overflow.
Fixes: QTBUG-109477
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I198c6fa5a2551a951893515f905bb7cc35479608
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/image/qimage_neon.cpp')
-rw-r--r-- | src/gui/image/qimage_neon.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp index d3437b2818..b513dc2894 100644 --- a/src/gui/image/qimage_neon.cpp +++ b/src/gui/image/qimage_neon.cpp @@ -18,7 +18,7 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, cons // align dst on 128 bits const int offsetToAlignOn16Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x3; - for (int i = 0; i < offsetToAlignOn16Bytes; ++i) { + for (int i = 0; i < qMin(len, offsetToAlignOn16Bytes); ++i) { *dst++ = qRgb(src[0], src[1], src[2]); src += 3; } |