XFree86 DGA: Guard against NULL pointer dereferences.

Ass, u, me ...
This commit is contained in:
Daniel Stone 2007-03-21 02:35:31 +02:00 committed by Daniel Stone
parent f292de2ef1
commit 3e9f7a5504

View File

@ -423,6 +423,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
#if XFreeXDGA
if (first_valuator == 0 && num_valuators >= 2) {
if (miPointerGetScreen(inputInfo.pointer)) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (is_absolute) {
dx = valuators[0] - device->valuator->lastx;
@ -435,6 +436,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
if (DGAStealMotionEvent(index, dx, dy))
goto out;
}
}
#endif
if (!xf86Events)
@ -505,9 +507,11 @@ xf86PostButtonEvent(DeviceIntPtr device,
int index;
#if XFreeXDGA
if (miPointerGetScreen(inputInfo.pointer)) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (DGAStealButtonEvent(index, button, is_down))
return;
}
#endif
valuators = xcalloc(sizeof(int), num_valuators);
@ -588,9 +592,11 @@ xf86PostKeyboardEvent(DeviceIntPtr device,
int index;
#if XFreeXDGA
if (miPointerGetScreen(inputInfo.pointer)) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (DGAStealKeyEvent(index, key_code, is_down))
return;
}
#endif
if (!xf86Events)