summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2022-01-13 00:47:27 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2022-01-24 18:04:20 +0100
commitd2ce97bd02c16ae162c49f76a00fc858035f288e (patch)
tree55467ff4bc68be1f9b4a9b9b75584733554cddb3
parent97c5b77774595c4dcef07223cd2684fea5201d5e (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> (cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c)
-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 3c68e690b..11391adbb 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -168,6 +168,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);
}
@@ -206,6 +209,9 @@ present_flush(WindowPtr window)
if (!screen_priv->info)
return;
+ if (!screen_priv->info->flush)
+ return;
+
(*screen_priv->info->flush) (window);
}