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,17 +423,19 @@ xf86PostMotionEvent(DeviceIntPtr device,
#if XFreeXDGA
if (first_valuator == 0 && num_valuators >= 2) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (is_absolute) {
dx = valuators[0] - device->valuator->lastx;
dy = valuators[1] - device->valuator->lasty;
if (miPointerGetScreen(inputInfo.pointer)) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (is_absolute) {
dx = valuators[0] - device->valuator->lastx;
dy = valuators[1] - device->valuator->lasty;
}
else {
dx = valuators[0];
dy = valuators[1];
}
if (DGAStealMotionEvent(index, dx, dy))
goto out;
}
else {
dx = valuators[0];
dy = valuators[1];
}
if (DGAStealMotionEvent(index, dx, dy))
goto out;
}
#endif
@ -505,9 +507,11 @@ xf86PostButtonEvent(DeviceIntPtr device,
int index;
#if XFreeXDGA
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (DGAStealButtonEvent(index, button, is_down))
return;
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
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (DGAStealKeyEvent(index, key_code, is_down))
return;
if (miPointerGetScreen(inputInfo.pointer)) {
index = miPointerGetScreen(inputInfo.pointer)->myNum;
if (DGAStealKeyEvent(index, key_code, is_down))
return;
}
#endif
if (!xf86Events)