Blame SOURCES/0001-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch

61240a
From 6a5e47c57d16de8b6a6a2636f3cbad1aebec32e2 Mon Sep 17 00:00:00 2001
61240a
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
61240a
Date: Mon, 27 Jan 2020 17:47:10 +0100
61240a
Subject: [PATCH xserver] xfree86/modes: Bail from xf86RotateRedisplay if
61240a
 pScreen->root is NULL
61240a
MIME-Version: 1.0
61240a
Content-Type: text/plain; charset=UTF-8
61240a
Content-Transfer-Encoding: 8bit
61240a
61240a
Avoids a crash in xf86RotatePrepare -> DamageRegister during
61240a
CreateScreenResources if rotation or another transform is configured for
61240a
any connected RandR output in xorg.conf. The generic rotation/transform
61240a
code generally can't work without the root window currently.
61240a
61240a
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/969
61240a
Fixes: 094f42cdfe5d "xfree86/modes: Call xf86RotateRedisplay from
61240a
                     xf86CrtcRotate"
61240a
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
61240a
Reviewed-by: Adam Jackson <ajax@redhat.com>
61240a
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
61240a
---
61240a
 hw/xfree86/modes/xf86Rotate.c | 2 +-
61240a
 1 file changed, 1 insertion(+), 1 deletion(-)
61240a
61240a
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
61240a
index 05944cfcb..5415ed97c 100644
61240a
--- a/hw/xfree86/modes/xf86Rotate.c
61240a
+++ b/hw/xfree86/modes/xf86Rotate.c
61240a
@@ -176,7 +176,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
61240a
     DamagePtr damage = xf86_config->rotation_damage;
61240a
     RegionPtr region;
61240a
 
61240a
-    if (!damage)
61240a
+    if (!damage || !pScreen->root)
61240a
         return FALSE;
61240a
     xf86RotatePrepare(pScreen);
61240a
     region = DamageRegion(damage);
61240a
-- 
61240a
2.24.1
61240a