aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-15 10:59:16 +0200
committermarha <marha@users.sourceforge.net>2011-07-15 10:59:16 +0200
commit4b424e0ba999b47ca62298e8104f76f940aac4d8 (patch)
treeeb1d6080a9676c73118f5fe79adfdf62cae81c12
parentcfe47427e85b626bfb92c6ecb6eb43a2eb80a552 (diff)
downloadvcxsrv-4b424e0ba999b47ca62298e8104f76f940aac4d8.tar.gz
vcxsrv-4b424e0ba999b47ca62298e8104f76f940aac4d8.tar.bz2
vcxsrv-4b424e0ba999b47ca62298e8104f76f940aac4d8.zip
Solved possible crash because of invalid valdata pointers
-rw-r--r--xorg-server/mi/mivaltree.c14
-rw-r--r--xorg-server/mi/miwindow.c2
2 files changed, 11 insertions, 5 deletions
diff --git a/xorg-server/mi/mivaltree.c b/xorg-server/mi/mivaltree.c
index 36ec8e60a..6db2633be 100644
--- a/xorg-server/mi/mivaltree.c
+++ b/xorg-server/mi/mivaltree.c
@@ -296,6 +296,9 @@ miComputeClips (
((pParent->eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask))
SendVisibilityNotify(pParent);
+ if (pParent->valdata==UnmapValData)
+ return; // return if no valid valdata
+
dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x;
dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y;
@@ -779,9 +782,11 @@ miValidateTree (
RegionUninit(&childUnion);
}
- RegionNull(&pParent->valdata->after.exposed);
- RegionNull(&pParent->valdata->after.borderExposed);
-
+ if (pParent->valdata && pParent->valdata!=UnmapValData)
+ {
+ RegionNull(&pParent->valdata->after.exposed);
+ RegionNull(&pParent->valdata->after.borderExposed);
+ }
/*
* each case below is responsible for updating the
* clipList and serial number for the parent window
@@ -796,7 +801,8 @@ miValidateTree (
* exposures and obscures as per miComputeClips and reset the parent's
* clipList.
*/
- RegionSubtract(&pParent->valdata->after.exposed,
+ if (pParent->valdata && pParent->valdata!=UnmapValData)
+ RegionSubtract(&pParent->valdata->after.exposed,
&totalClip, &pParent->clipList);
/* fall through */
case VTMap:
diff --git a/xorg-server/mi/miwindow.c b/xorg-server/mi/miwindow.c
index 55a86dd13..87d474ff2 100644
--- a/xorg-server/mi/miwindow.c
+++ b/xorg-server/mi/miwindow.c
@@ -228,7 +228,7 @@ miHandleValidateExposures(WindowPtr pWin)
WindowExposures = pChild->drawable.pScreen->WindowExposures;
while (1)
{
- if ( (val = pChild->valdata) )
+ if ( (val = pChild->valdata) && val!=UnmapValData)
{
if (RegionNotEmpty(&val->after.borderExposed))
miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);