mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
glx: Add some NULL pointer checks
This prevents mesa from segfaulting if GLX is working on some screens, but not all screens. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: stefan11111 <stefan11111@shitposting.expert> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38201>
This commit is contained in:
parent
041216e605
commit
37f1d19a68
1 changed files with 2 additions and 1 deletions
|
|
@ -157,7 +157,7 @@ GetGLXPrivScreenConfig(Display * dpy, int scrn, struct glx_display ** ppriv,
|
|||
|
||||
/* Check to see if the GL is supported on this screen */
|
||||
*ppsc = (*ppriv)->screens[scrn];
|
||||
if ((*ppsc)->configs == NULL && (*ppsc)->visuals == NULL) {
|
||||
if (*ppsc == NULL || ((*ppsc)->configs == NULL && (*ppsc)->visuals == NULL)) {
|
||||
/* No support for GL on this screen regardless of visual */
|
||||
return GLX_BAD_VISUAL;
|
||||
}
|
||||
|
|
@ -1477,6 +1477,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements)
|
|||
*nelements = 0;
|
||||
if (priv && (priv->screens != NULL)
|
||||
&& (screen >= 0) && (screen < ScreenCount(dpy))
|
||||
&& (priv->screens[screen] != NULL)
|
||||
&& (priv->screens[screen]->configs != NULL)
|
||||
&& (priv->screens[screen]->configs->fbconfigID
|
||||
!= (int) GLX_DONT_CARE)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue