Commit 5cff2b6f authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix a threading crash caused by transformation masks

The mask must not access pixels outside its need rect, it breaks
a contract between it and the scheduler. And since affine transformations
use bilinear interpolation, we should provide one more pixel in needRect.

BUG:412488
parent 7b147c93
......@@ -374,6 +374,13 @@ QRect KisTransformMask::needRect(const QRect& rect, PositionToFilthy pos) const
KisSafeTransform transform(m_d->worker.forwardTransform(), limitingRect, interestRect);
needRect = transform.mapRectBackward(rect);
/**
* When sampling affine transformations we use KisRandomSubAccessor,
* which uses bilinear interpolation for calculating pixels. Therefore,
* we need to extend the sides of the need rect by one pixel.
*/
needRect = kisGrowRect(needRect, 1);
} else {
needRect = m_d->params->nonAffineNeedRect(rect, interestRect);
}
......
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