summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86Rotate.c-Add-required-NULL-check.patch
blob: 8c086ddb14b489cd86d9f6eed920f96e8ff0a77c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From e94754360160cfe4faada7b9a523e57004b39e74 Mon Sep 17 00:00:00 2001
From: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
Date: Thu, 15 Aug 2024 15:48:21 -0700
Subject: [PATCH] xf86Rotate.c: Add required NULL check

Add missing NULL check on BlockHandler callback before invoking it. There
is no guarantee that said callback is always defined.

Fixes xorg crash on startup when screen rotation is specified in the config
file.

Upstream-Status: Pending

Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
---
 hw/xfree86/modes/xf86Rotate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index ea9c43c..43eab53 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -230,7 +230,8 @@ xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout)
 
     xf86RotateRedisplay(pScreen);
 
-    (*pScreen->BlockHandler) (pScreen, pTimeout);
+    if (pScreen->BlockHandler)
+        (*pScreen->BlockHandler) (pScreen, pTimeout);
 
     /* Re-wrap if we still need this hook */
     if (xf86_config->rotation_damage != NULL) {
-- 
2.25.1