aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-11 22:31:32 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-11 22:31:32 +0000
commit0486e8a71462430438a1ac593db0ffe0fb38b9a8 (patch)
treea1ea02462b2442366efc1e2f7d858514c8f8b125 /vnc.c
parentf5fdd0a855decf395561f49b96ee50aad5b0feaa (diff)
Fix fragments due to incomplete dirty tracking in CGA mode (Anthony Liguori).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3809 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index fcce00eddc..b20fe21d7d 100644
--- a/vnc.c
+++ b/vnc.c
@@ -258,6 +258,13 @@ static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
h += y;
+ /* round x down to ensure the loop only spans one 16-pixel block per,
+ iteration. otherwise, if (x % 16) != 0, the last iteration may span
+ two 16-pixel blocks but we only mark the first as dirty
+ */
+ w += (x % 16);
+ x -= (x % 16);
+
for (; y < h; y++)
for (i = 0; i < w; i += 16)
vnc_set_bit(vs->dirty_row[y], (x + i) / 16);