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 c82f814313
)
This commit is contained in:
parent
642c1f83b9
commit
2dd9dfc8d9
|
@ -401,17 +401,22 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
|
||||||
if (crtc->scanout_pixmap_back) {
|
if (crtc->scanout_pixmap_back) {
|
||||||
pScrPriv->rrDisableSharedPixmapFlipping(crtc);
|
pScrPriv->rrDisableSharedPixmapFlipping(crtc);
|
||||||
|
|
||||||
master->StopFlippingPixmapTracking(mrootdraw,
|
if (mrootdraw) {
|
||||||
crtc->scanout_pixmap,
|
master->StopFlippingPixmapTracking(mrootdraw,
|
||||||
crtc->scanout_pixmap_back);
|
crtc->scanout_pixmap,
|
||||||
|
crtc->scanout_pixmap_back);
|
||||||
|
}
|
||||||
|
|
||||||
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back);
|
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back);
|
||||||
crtc->scanout_pixmap_back = NULL;
|
crtc->scanout_pixmap_back = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
|
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
|
||||||
master->StopPixmapTracking(mrootdraw,
|
|
||||||
crtc->scanout_pixmap);
|
if (mrootdraw) {
|
||||||
|
master->StopPixmapTracking(mrootdraw,
|
||||||
|
crtc->scanout_pixmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap);
|
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap);
|
||||||
|
|
Loading…
Reference in New Issue