[mutter/wip/carlosg/coverity-fixes: 3/12] cogl: Fix broken check for COGL_DISABLE_GL_EXTENSION envvar
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 3/12] cogl: Fix broken check for COGL_DISABLE_GL_EXTENSION envvar
- Date: Mon, 25 Oct 2021 13:45:57 +0000 (UTC)
commit cb365ebd73c568ac7030c0e473ade2733ea71d98
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 24 20:54:17 2021 +0200
cogl: Fix broken check for COGL_DISABLE_GL_EXTENSION envvar
This check was always true since the variable is already set in the
if() condition above. Presumably this was meant to check for empty
strings, so do that.
CID: #1491518
cogl/cogl/driver/gl/cogl-util-gl.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/cogl-util-gl.c b/cogl/cogl/driver/gl/cogl-util-gl.c
index 80c4179130..59d2e74d44 100644
--- a/cogl/cogl/driver/gl/cogl-util-gl.c
+++ b/cogl/cogl/driver/gl/cogl-util-gl.c
@@ -363,13 +363,17 @@ _cogl_context_get_gl_extensions (CoglContext *context)
char **split_env_disabled_extensions;
char **src, **dst;
- if (env_disabled_extensions)
- split_env_disabled_extensions =
- g_strsplit (env_disabled_extensions,
- ",",
- 0 /* no max tokens */);
+ if (*env_disabled_extensions)
+ {
+ split_env_disabled_extensions =
+ g_strsplit (env_disabled_extensions,
+ ",",
+ 0 /* no max tokens */);
+ }
else
- split_env_disabled_extensions = NULL;
+ {
+ split_env_disabled_extensions = NULL;
+ }
for (dst = ret, src = ret;
*src;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]