xorg-x11-server/SOURCES/0001-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch
2021-09-10 06:09:15 +00:00

41 lines
1.5 KiB
Diff

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