summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2021-07-09 12:10:27 +0200
committerMichel Dänzer <mdaenzer@redhat.com>2021-07-09 12:10:27 +0200
commit96829a7b19f0dbc3f1c50f968e64503c942013ad (patch)
tree4b93127ac1d489ec28193f0ebc6ff29f430d499f
parentbfd7e302fcc33b95216a9fedb52e91c5cb51e1cf (diff)
randr: Bail from RRTellChanged if there's no root window yet
This can happen if RRTellChanged is called during initialization. Continuing in that case makes no sense conceptually: * Any event sent over the wire requires a corresponding window. * No root window probably means there can't be any clients which could receive the events. In practice, it would result in a crash down the road due to dereferencing the NULL ScreenRec::root pointer. Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit a6d178b6af4bb4cd7ba28299c3ddd9d90bcbaaa5)
-rw-r--r--randr/randr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/randr/randr.c b/randr/randr.c
index a4f519888..3f94c2f6c 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -615,6 +615,10 @@ RRTellChanged(ScreenPtr pScreen)
primarysp = pScrPriv;
}
+ /* If there's no root window yet, can't send events */
+ if (!primary->root)
+ return;
+
xorg_list_for_each_entry(iter, &primary->secondary_list, secondary_head) {
pSecondaryScrPriv = rrGetScrPriv(iter);