summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-07-27 16:02:28 -0400
committerAdam Jackson <ajax@redhat.com>2017-08-11 11:15:19 -0400
commitf80119120c487581ac050ce741808f7c8f438f35 (patch)
tree087b4c5328dda0e2c5ab4ca03bacea97adcf5829 /composite
parentb06a85e7fd6ddac58dd97e5d7ce3b5ea9553c8f6 (diff)
composite: Make compIsAlternateVisual safe even if Composite is off
As of ea483af9 we'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>
Diffstat (limited to 'composite')
-rw-r--r--composite/compwindow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 367f23eb7..f88238146 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -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;