diff options
Diffstat (limited to 'sys/dev/usb/uts.c')
| -rw-r--r-- | sys/dev/usb/uts.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c index 78b9424c5df..a626015ede3 100644 --- a/sys/dev/usb/uts.c +++ b/sys/dev/usb/uts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uts.c,v 1.28 2011/01/25 20:03:36 jakemsr Exp $ */ +/* $OpenBSD: uts.c,v 1.29 2011/03/03 21:48:49 kettenis Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -339,6 +339,8 @@ uts_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *l) wsmc->resx >= 0 && wsmc->resy >= 0 && wsmc->minx < 32768 && wsmc->maxx < 32768 && wsmc->miny < 32768 && wsmc->maxy < 32768 && + (wsmc->maxx - wsmc->minx) != 0 && + (wsmc->maxy - wsmc->miny) != 0 && wsmc->resx < 32768 && wsmc->resy < 32768 && wsmc->swapxy >= 0 && wsmc->swapxy <= 1 && wsmc->samplelen >= 0 && wsmc->samplelen <= 1)) @@ -430,7 +432,9 @@ uts_get_pos(usbd_private_handle addr, struct uts_pos *tp) tp->x = x; tp->y = y; } - if (!sc->sc_rawmode) { + if (!sc->sc_rawmode && + (sc->sc_tsscale.maxx - sc->sc_tsscale.minx) != 0 && + (sc->sc_tsscale.maxy - sc->sc_tsscale.miny) != 0) { /* Scale down to the screen resolution. */ tp->x = ((tp->x - sc->sc_tsscale.minx) * sc->sc_tsscale.resx) / |
