diff options
author | Alex Goins <agoins@nvidia.com> | 2019-09-04 12:25:31 -0500 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2019-11-11 14:35:57 -0800 |
commit | c82f814313a813d7e1a2d7d3b1f7561810446b34 (patch) | |
tree | 78309cbd868b5171dec832c5b9346dfc6222c6e4 /randr | |
parent | fe439596b99db65bbae35eff1ea0b79db167f8d6 (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>
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrcrtc.c | 15 |
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); |