diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h index 729b85c4d5..cf725632f4 100644 --- a/src/gui/rhi/qrhi_p_p.h +++ b/src/gui/rhi/qrhi_p_p.h @@ -260,11 +260,11 @@ bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array(0, inputWidth - widthOffset) : 0; + *h = *y < outputHeight ? qMax(0, inputHeight - heightOffset) : 0; *x = qBound(0, *x, outputWidth - 1); *y = qBound(0, *y, outputHeight - 1); - *w = qMax(0, inputWidth - widthOffset); - *h = qMax(0, inputHeight - heightOffset); if (*x + *w > outputWidth) *w = qMax(0, outputWidth - *x);