summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qimage.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 64a53b4c0e..2911477d28 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2455,10 +2455,16 @@ QColor QImage::pixelColor(int x, int y) const
*/
void QImage::setPixelColor(int x, int y, const QColor &color)
{
- if (!d || x < 0 || x >= width() || y < 0 || y >= height() || !color.isValid()) {
+ if (!d || x < 0 || x >= width() || y < 0 || y >= height()) {
qWarning("QImage::setPixelColor: coordinate (%d,%d) out of range", x, y);
return;
}
+
+ if (!color.isValid()) {
+ qWarning("QImage::setPixelColor: color is invalid");
+ return;
+ }
+
// QColor is always unpremultiplied
QRgba64 c = color.rgba64();
if (!hasAlphaChannel())