Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Fix a crash in KisVisualColorModel
Dmitry Kazakovb6ac1e7d8c33
diff --git a/libs/widgets/KisVisualColorModel.cpp b/libs/widgets/KisVisualColorModel.cppindex 615d58e4ca..6e41c5a957 100644--- a/libs/widgets/KisVisualColorModel.cpp+++ b/libs/widgets/KisVisualColorModel.cpp@@ -253,7 +253,9 @@ KoColor KisVisualColorModel::convertChannelValuesToKoColor(const QVector4D &valu}if (m_d->exposureSupported) {- baseValues *= m_d->channelMaxValues;+ for (int i = 0; i < m_d->colorChannelCount; i++) {+ baseValues[i] *= m_d->channelMaxValues[i];+ }}for (int i=0; i<m_d->colorChannelCount; i++) {@@ -281,7 +283,9 @@ QVector4D KisVisualColorModel::convertKoColorToChannelValues(KoColor c) const}if (m_d->exposureSupported) {- channelValuesDisplay /= m_d->channelMaxValues;+ for (int i = 0; i < m_d->colorChannelCount; i++) {+ channelValuesDisplay[i] /= m_d->channelMaxValues[i];+ }}if (m_d->model != ColorModel::Channel && m_d->isRGBA) {if (m_d->applyGamma) {