mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-03 12:50:14 +01:00
composite: Make compIsAlternateVisual safe even if Composite is off
As ofea483af9we're calling this unconditionally from the GLX code so the synthetic visual is in a lower select group. If Composite has been disabled then GetCompScreen() will return NULL, and this would crash. Rather than force the caller to check first, just always return FALSE if Composite is disabled (which is correct, since none of the visuals will be synthetic in that case). Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> (cherry picked from commitf80119120c)
This commit is contained in:
parent
06d1c83d04
commit
0a73e7bf10
1 changed files with 1 additions and 1 deletions
|
|
@ -326,7 +326,7 @@ compIsAlternateVisual(ScreenPtr pScreen, XID visual)
|
|||
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < cs->numAlternateVisuals; i++)
|
||||
for (i = 0; cs && i < cs->numAlternateVisuals; i++)
|
||||
if (cs->alternateVisuals[i] == visual)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue