From b65f05f42b28f4b0566267b9d5e7db0309a0c1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 2 Feb 2011 16:39:45 +0100 Subject: [PATCH] sanitize GL version stringlist BUG: 265131 --- lib/kwinglutils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index a01d1788a6..bc2856b27b 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -94,9 +94,10 @@ void initGL() // Get OpenGL version QString glversionstring = QString((const char*)glGetString(GL_VERSION)); QStringList glversioninfo = glversionstring.left(glversionstring.indexOf(' ')).split('.'); + while (glversioninfo.count() < 3) + glversioninfo << "0"; #ifndef KWIN_HAVE_OPENGLES - glVersion = MAKE_GL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), - glversioninfo.count() > 2 ? glversioninfo[2].toInt() : 0); + glVersion = MAKE_GL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), glversioninfo[2].toInt()); #endif // Get list of supported OpenGL extensions glExtensions = QString((const char*)glGetString(GL_EXTENSIONS)).split(' ');