diff options
author | Dave Airlie <airlied@redhat.com> | 2008-05-19 11:16:08 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-05-19 11:16:08 +1000 |
commit | 7dca84f3ee7265119fb81d598d7d2f7363e25f1f (patch) | |
tree | 407dd1238b86003e4c5a3f81580571e9551ee7af | |
parent | 5af5db5033582a84b616d5c50f4288adb0210459 (diff) |
cursor: don't dereference NULL pointer is devPrivates not yet set.
This fixes a bug on server recycle with ati zaphod.
-rw-r--r-- | hw/xfree86/modes/xf86Cursors.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 57cfcb65a..19fe9f5ee 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -613,18 +613,17 @@ xf86_reload_cursors (ScreenPtr screen) if (cursor) { +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) + void *src = dixLookupPrivate(&cursor->devPrivates, screen); +#else + void *src = cursor->devPriv[screen->myNum]; +#endif #ifdef ARGB_CURSOR if (cursor->bits->argb && cursor_info->LoadCursorARGB) (*cursor_info->LoadCursorARGB) (scrn, cursor); - else -#endif - (*cursor_info->LoadCursorImage)(cursor_info->pScrn, -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) - dixLookupPrivate(&cursor->devPrivates, screen) -#else - cursor->devPriv[screen->myNum] + else if (src) #endif - ); + (*cursor_info->LoadCursorImage)(cursor_info->pScrn, src); (*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y); (*cursor_info->ShowCursor)(cursor_info->pScrn); |