summaryrefslogtreecommitdiff
path: root/x11-base/xorg-server/files/xorg-server-21.1.3-present-null-check.patch
blob: 15d653320708bdc6ce4aa2a8f0968335570b0936 (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
36
https://gitlab.freedesktop.org/xorg/xserver/-/commit/22d58188
https://bugs.gentoo.org/830482

From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Thu, 13 Jan 2022 00:47:27 +0100
Subject: [PATCH] present: Check for NULL to prevent crash
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275
Signed-off-by: Błażej Szczygieł <spaz16@wp.pl>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -158,6 +158,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window)
     if (!screen_priv->info)
         return NULL;
 
+    if (!screen_priv->info->get_crtc)
+        return NULL;
+
     return (*screen_priv->info->get_crtc)(window);
 }
 
@@ -196,6 +199,9 @@ present_flush(WindowPtr window)
     if (!screen_priv->info)
         return;
 
+    if (!screen_priv->info->flush)
+        return;
+
     (*screen_priv->info->flush) (window);
 }
 
GitLab