xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Fri Aug 11 15:15:48 UTC 2017


 composite/compwindow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f80119120c487581ac050ce741808f7c8f438f35
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jul 27 16:02:28 2017 -0400

    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 at redhat.com>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>

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;


More information about the xorg-commit mailing list