summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2022-01-13 00:47:27 +0100
committerAaron Plattner <aplattner@nvidia.com>2022-01-19 10:23:20 -0800
commit22d5818851967408bb7c903cb345b7ca8766094c (patch)
tree4030362d9f4e6c1a2a96503d65ba63c363427cfe
parentd1f26c3e7566ebb6178a855b08b0f06dec730fb5 (diff)
present: Check for NULL to prevent crash
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>
-rw-r--r--present/present_scmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/present/present_scmd.c b/present/present_scmd.c
index da836ea6b..239055bc1 100644
--- 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);
}