diff options
author | 2010-11-26 21:03:36 +0000 | |
---|---|---|
committer | 2010-11-26 21:03:36 +0000 | |
commit | 46ed5d682171eb8f18ab754d6fd12f65e6ab1d3d (patch) | |
tree | 787075277665abd4290672602cf50403f698cb1c /sys | |
parent | Oops, removed a few lines too many in previous change. (diff) | |
download | wireguard-openbsd-46ed5d682171eb8f18ab754d6fd12f65e6ab1d3d.tar.xz wireguard-openbsd-46ed5d682171eb8f18ab754d6fd12f65e6ab1d3d.zip |
In gfxp_copyrect(), make sure that the - possibly negative - coordinate fields, which are supposed to be 16 bit values, are properly masked to avoid polluting
other fields.
From NetBSD; ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/gfxp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/gfxp.c b/sys/arch/sparc64/dev/gfxp.c index b3b36741d02..efb59603e63 100644 --- a/sys/arch/sparc64/dev/gfxp.c +++ b/sys/arch/sparc64/dev/gfxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gfxp.c,v 1.11 2009/09/05 14:09:35 miod Exp $ */ +/* $OpenBSD: gfxp.c,v 1.12 2010/11/26 21:03:36 miod Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -645,7 +645,7 @@ gfxp_copyrect(struct gfxp_softc *sc, int sx, int sy, int dx, int dy, bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_CONFIG, PM2_CONFIG_FB_WRITE_EN | PM2_CONFIG_FB_READ_SRC_EN); bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_FB_SRC_DELTA, - PM2_COORDS(sx - dx, sy - dy)); + PM2_COORDS((sx - dx) & 0xffff, (sy - dy) & 0xffff)); bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_RECT_ORIG, PM2_COORDS(dx, dy)); bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_RECT_SIZE, |