Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.8.1
-
None
-
Ubuntu 10.4
-
46e6bbd22991dd62040ee1eb24433b5f7316793a
Description
In QRect::operator& INT_MAX is exceeded if very large rectangles are used. In QRect::operator&() x2-x1 overflows the INT_MAX.
The code snippet below can be used to reproduce the issue:
#include <QDebug> #include <QRect> #include <QPoint> int main(int argc, char *argv[]) { QRect r1(QPoint(-2000000000, 2000000000), QPoint(2000000000, -2000000000)); QRect r2(QPoint(0, 100), QPoint(100, 0)); bool isec = r1.intersects(r2); QRect rIsec = r1 & r2; qDebug() << "Intersection:" << isec << rIsec.left() << rIsec.y() + rIsec.height() << rIsec.x() + rIsec.width() << rIsec.top(); qDebug() << rIsec.isNull(); qDebug() << rIsec; return 0; }