glx: return GL_FALSE from glx_screen_init where applicable.
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 30 Sep 2016 10:01:27 +0000 (11:01 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 6 Oct 2016 14:03:47 +0000 (15:03 +0100)
Return GL_FALSE if we fail to find any fb/visual configs, otherwise we
end up with all sorts of chaos further down the GLX stack.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/glxext.c

index f6bc377add5087741a52ebdabc2772af6141c342..9ef7ff5f694761b4c9a6eabb0ec89bdf0a40b009 100644 (file)
@@ -748,8 +748,11 @@ glx_screen_init(struct glx_screen *psc,
    psc->dpy = priv->dpy;
    psc->display = priv;
 
-   getVisualConfigs(psc, priv, screen);
-   getFBConfigs(psc, priv, screen);
+   if (!getVisualConfigs(psc, priv, screen))
+      return GL_FALSE;
+
+   if (!getFBConfigs(psc, priv, screen))
+      return GL_FALSE;
 
    return GL_TRUE;
 }