PS/2 bus manager check all valid values
According to korli "Valid values seem to be between 255 and -256" which is verified by syslog running on virtual box with a PS/2 mouse on Haiku hrev47470. Fixes #7802 Signed-off-by: John Scipione <[email protected]>
This commit is contained in:
@@ -230,7 +230,7 @@ standard_mouse_handle_int(ps2_dev* dev)
|
|||||||
if (cookie->packet_index == 1) {
|
if (cookie->packet_index == 1) {
|
||||||
int xDelta
|
int xDelta
|
||||||
= ((cookie->buffer[0] & 0x10) ? 0xFFFFFF00 : 0) | data;
|
= ((cookie->buffer[0] & 0x10) ? 0xFFFFFF00 : 0) | data;
|
||||||
if (xDelta < -100 || xDelta > 100) {
|
if (xDelta < -256 || xDelta > 255) {
|
||||||
INFO("ps2: strange mouse data, x-delta %d, trying resync\n",
|
INFO("ps2: strange mouse data, x-delta %d, trying resync\n",
|
||||||
xDelta);
|
xDelta);
|
||||||
cookie->packet_index = 0;
|
cookie->packet_index = 0;
|
||||||
@@ -240,7 +240,7 @@ standard_mouse_handle_int(ps2_dev* dev)
|
|||||||
if (cookie->packet_index == 2) {
|
if (cookie->packet_index == 2) {
|
||||||
int yDelta
|
int yDelta
|
||||||
= ((cookie->buffer[0] & 0x20) ? 0xFFFFFF00 : 0) | data;
|
= ((cookie->buffer[0] & 0x20) ? 0xFFFFFF00 : 0) | data;
|
||||||
if (yDelta < -100 || yDelta > 100) {
|
if (yDelta < -256 || yDelta > 255) {
|
||||||
INFO("ps2: strange mouse data, y-delta %d, trying resync\n",
|
INFO("ps2: strange mouse data, y-delta %d, trying resync\n",
|
||||||
yDelta);
|
yDelta);
|
||||||
cookie->packet_index = 0;
|
cookie->packet_index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user