QOpenGLExtensionMatcher: Fix possible use of unintialized memory

Some drivers don't support GL_NUM_EXTENSIONS, so we may be reading
random bits from numExtensions.

Change-Id: Ibe61fa6d7c379f3f1428458edd3e0ddba0eb04d7
Task-number: QTBUG-48943
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Gabriel de Dietrich 2016-02-05 10:45:20 -08:00
parent a3b8e355fc
commit 9212727813

View File

@ -79,7 +79,7 @@ QOpenGLExtensionMatcher::QOpenGLExtensionMatcher()
if (!glGetStringi)
return;
GLint numExtensions;
GLint numExtensions = 0;
funcs->glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
for (int i = 0; i < numExtensions; ++i) {