[mutter/wip/carlosg/coverity-fixes: 4/13] cogl: Fix broken check for COGL_DISABLE_GL_EXTENSION envvar




commit 774f120ac41033db80322a6b65d73a20559a7362
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
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>

 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]