Index: vnc.c =================================================================== RCS file: /sources/qemu/qemu/vnc.c,v retrieving revision 1.13 diff -u -r1.13 vnc.c --- vnc.c 19 Mar 2007 15:17:08 -0000 1.13 +++ vnc.c 9 Apr 2007 01:24:19 -0000 @@ -852,6 +852,11 @@ int x_position, int y_position, int w, int h) { + if (x_position > vs->ds->width) x_position = vs->ds->width; + if (y_position > vs->ds->height) y_position = vs->ds->height; + if (x_position + w >= vs->ds->width) w = vs->ds->width - x_position; + if (y_position + h >= vs->ds->height) h = vs->ds->height - y_position; + int i; vs->need_update = 1; if (!incremental) {