xserver: Branch 'master'
Daniel Stone
daniels at kemper.freedesktop.org
Wed Mar 21 02:35:28 EET 2007
hw/xfree86/common/xf86Xinput.c | 38 ++++++++++++++++++++++----------------
1 files changed, 22 insertions(+), 16 deletions(-)
New commits:
diff-tree 3e9f7a5504ab41d845e88f293d8498c963d8a7d8 (from f292de2ef13dc994a38029cee9e2642576893332)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 02:35:31 2007 +0200
XFree86 DGA: Guard against NULL pointer dereferences.
Ass, u, me ...
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index c9c8059..17ffed8 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -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;
- }
- else {
- dx = valuators[0];
- dy = valuators[1];
+ 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;
}
- 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
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)
More information about the xorg-commit
mailing list