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 <jscipione@gmail.com>
This commit is contained in:
John Scipione 2014-07-07 19:02:45 -04:00
parent a394a16a61
commit ca45c75350

View File

@ -230,7 +230,7 @@ standard_mouse_handle_int(ps2_dev* dev)
if (cookie->packet_index == 1) {
int xDelta
= ((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",
xDelta);
cookie->packet_index = 0;
@ -240,7 +240,7 @@ standard_mouse_handle_int(ps2_dev* dev)
if (cookie->packet_index == 2) {
int yDelta
= ((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",
yDelta);
cookie->packet_index = 0;