Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.8.4
-
None
-
Windows 7 32bit
-
a298216bb4383dbe96688dfb80da0cd875766de0 (5.1) 69ee30260a667b2b977a0d4b52abf6537521cce8 (5.1) e7ac2a9bba2925149bac6dda0f391275997abada (4.8) 0daeee468ccc76dfb957892050b4c11d4807e2d3 (4.8)
Description
Updating widgets on 32-bit system fails when rectangles are positioned to the edge of integer (INT_MIN, INT_MAX).
ASSERT: "extents.intersects(rect)" in file painting\qregion.cpp, line 1255
The attached application can be used to reproduce the issue. There the failure is illustrated by calling the update() method with valid rectangles.
void MainWindow::onUpdateAction() { { QRect r(ui->pushButton->rect()); r.setLeft(-2147483648); r.setWidth(1); ui->pushButton->update(r); } { QRect r(ui->pushButton->rect()); r.setLeft(1395387); r.setWidth(1); ui->pushButton->update(r); } }
It looks like in ‘QRegion QRegion::intersect(const QRect &r) const’ the ‘result.d->qt_rgn’ rectangle is not constructed correctly (it’s width is over INT_MIN).
Attached also stack trace of the crash.
Attachments
For Gerrit Dashboard: QTBUG-30876 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
54800,2 | Prevent crash due to giving QWidget::update() a large rect. | stable | qt/qtbase | Status: MERGED | +2 | 0 |
54968,1 | Prevent crash due to giving QWidget::update() a large region. | stable | qt/qtbase | Status: MERGED | +2 | 0 |
56155,1 | Prevent crash due to giving QWidget::update() a large rect. | 4.8 | qt/qt | Status: MERGED | +2 | 0 |
56157,1 | Prevent crash due to giving QWidget::update() a large region. | 4.8 | qt/qt | Status: MERGED | +2 | 0 |