diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-28 11:37:21 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-28 11:37:21 +0930 |
commit | 1fab51edfc82e1ef60dfa29fd5d93478066a3998 (patch) | |
tree | 7f87ea0a3dd0e84033dedd5fbf60e1778aa62097 /mi/misprite.c | |
parent | b5004722a208479a4bc762ff428bf4cbeb430d53 (diff) |
mi: guard against NULL-pointer dereference.
Diffstat (limited to 'mi/misprite.c')
-rw-r--r-- | mi/misprite.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mi/misprite.c b/mi/misprite.c index c998e556a..9e4b6851e 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -916,12 +916,15 @@ miSpriteUndisplayCursor(pDev, pScreen) DeviceIntPtr pDev; ScreenPtr pScreen; { + miCursorInfoPtr pCursorInfo; + if (!pDev->isMaster && !pDev->u.master) { ErrorF("[mi] miSpriteUndisplayCursor called for floating device.\n"); return; } - if (MISPRITE(pDev)->isUp) + pCursorInfo = MISPRITE(pDev); + if (pCursorInfo && pCursorInfo->isUp) miSpriteRemoveCursor(pDev, pScreen); } |