Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3db0d0d6 authored by Agata Cacko's avatar Agata Cacko Committed by Dmitry Kazakov

Fix integer overflow in KisSimpleUpdateQueue

Casting to the wider type before multiplying will prevent
unnecessary overflow.
CID 35133
parent 367db37d
......@@ -370,10 +370,10 @@ bool KisSimpleUpdateQueue::joinRects(QRect& baseRect,
return false;
bool result = false;
qint64 baseWork = baseRect.width() * baseRect.height() +
newRect.width() * newRect.height();
qint64 baseWork = qint64(baseRect.width()) * baseRect.height() +
qint64(newRect.width()) * newRect.height();
qint64 newWork = unitedRect.width() * unitedRect.height();
qint64 newWork = qint64(unitedRect.width()) * unitedRect.height();
qreal alpha = qreal(newWork) / baseWork;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment