summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Goins <agoins@nvidia.com>2019-09-04 12:25:31 -0500
committerAaron Plattner <aplattner@nvidia.com>2019-11-11 14:46:32 -0800
commit2dd9dfc8d9a5dc906ee06d667a756ab267f55e64 (patch)
treeb280a51ca642d2c6881464bc40849656d40e1b29
parent642c1f83b9ed2452ceb20457a4423a8f52a7a8c4 (diff)
randr: Fix RRCrtcDetachScanoutPixmap() segfault during server teardown
During server teardown, mrootdraw is NULL, which can cause segfaults if master->Stop{,Flipping}PixmapTracking() don't do NULL checking. In this case we shouldn't need to do master->Stop{,Flipping}PixmapTracking() anyway, so just skip it. Signed-off-by: Alex Goins <agoins@nvidia.com> (cherry picked from commit c82f814313a813d7e1a2d7d3b1f7561810446b34)
-rw-r--r--randr/rrcrtc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index a851aebcc..ae7e30605 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -401,17 +401,22 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
if (crtc->scanout_pixmap_back) {
pScrPriv->rrDisableSharedPixmapFlipping(crtc);
- master->StopFlippingPixmapTracking(mrootdraw,
- crtc->scanout_pixmap,
- crtc->scanout_pixmap_back);
+ if (mrootdraw) {
+ master->StopFlippingPixmapTracking(mrootdraw,
+ crtc->scanout_pixmap,
+ crtc->scanout_pixmap_back);
+ }
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back);
crtc->scanout_pixmap_back = NULL;
}
else {
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
- master->StopPixmapTracking(mrootdraw,
- crtc->scanout_pixmap);
+
+ if (mrootdraw) {
+ master->StopPixmapTracking(mrootdraw,
+ crtc->scanout_pixmap);
+ }
}
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap);