summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-11-17 12:01:38 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-11-17 12:14:27 (GMT)
commit6ad33e1ff7618704fd41549780d0d0c93778364e (patch)
tree14dafc290f7d3b98e175d20c7db8b1ad64d8dd62 /tests
parentd68b5355b36e31dbeec2474d8469646358e0cd87 (diff)
downloadQt-6ad33e1ff7618704fd41549780d0d0c93778364e.zip
Qt-6ad33e1ff7618704fd41549780d0d0c93778364e.tar.gz
Qt-6ad33e1ff7618704fd41549780d0d0c93778364e.tar.bz2
Prevent crash in GL 2 engine when stroking null rectangle.
Task-number: QTBUG-15320 Reviewed-by: Kim
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgl/tst_qgl.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index e38bf42..cc2cac9 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -97,6 +97,7 @@ private slots:
void qglContextDefaultBindTexture();
void textureCleanup();
void threadImages();
+ void nullRectCrash();
};
tst_QGL::tst_QGL()
@@ -2375,6 +2376,28 @@ void tst_QGL::threadImages()
delete widget;
}
+void tst_QGL::nullRectCrash()
+{
+ if (!QGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle);
+
+ QGLWidget glw;
+ glw.makeCurrent();
+
+ QGLFramebufferObjectFormat fboFormat;
+ fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+
+ QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat);
+
+ QPainter fboPainter(fbo);
+
+ fboPainter.setPen(QPen(QColor(255, 127, 127, 127), 2));
+ fboPainter.setBrush(QColor(127, 255, 127, 127));
+ fboPainter.drawRect(QRectF());
+
+ fboPainter.end();
+}
+
class tst_QGLDummy : public QObject
{
Q_OBJECT