composite: Fix use-after-free in compReparentWindow
If an implicitly redirected window is unredirected by the reparent operation, cw will be a stale pointer. Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
ac13d740bf
commit
efd84bff23
|
@ -432,7 +432,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
|
|||
{
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||
CompWindowPtr cw = GetCompWindow(pWin);
|
||||
CompWindowPtr cw;
|
||||
|
||||
pScreen->ReparentWindow = cs->ReparentWindow;
|
||||
/*
|
||||
|
@ -471,6 +471,7 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
|
|||
cs->ReparentWindow = pScreen->ReparentWindow;
|
||||
pScreen->ReparentWindow = compReparentWindow;
|
||||
|
||||
cw = GetCompWindow(pWin);
|
||||
if (pWin->damagedDescendants || (cw && cw->damaged))
|
||||
compMarkAncestors(pWin);
|
||||
|
||||
|
|
Loading…
Reference in New Issue