diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-04-27 17:24:51 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-01 09:44:10 -0500 |
commit | bee1b01083b6adcf580fa30e65a2e59e7231af31 (patch) | |
tree | 03c823c5f8cfc35f80d8ef9e0abfb8d6ba4eadd6 /vnc.c | |
parent | 206ab6e090eeddce71372041454d50d93a63017d (diff) | |
download | qemu-bee1b01083b6adcf580fa30e65a2e59e7231af31.zip qemu-bee1b01083b6adcf580fa30e65a2e59e7231af31.tar.gz qemu-bee1b01083b6adcf580fa30e65a2e59e7231af31.tar.bz2 |
vnc: fix segfault
Move down cmp_bytes initialization. Must be after vga_hw_update()
call, because that one might change the screen depth.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vnc.c')
-rw-r--r-- | vnc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -705,7 +705,7 @@ static void vnc_update_client(void *opaque) int y; uint8_t *guest_row; uint8_t *server_row; - int cmp_bytes = 16 * ds_get_bytes_per_pixel(vs->ds); + int cmp_bytes; uint32_t width_mask[VNC_DIRTY_WORDS]; int n_rectangles; int saved_offset; @@ -725,6 +725,7 @@ static void vnc_update_client(void *opaque) * Update server dirty map. */ vnc_set_bits(width_mask, (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS); + cmp_bytes = 16 * ds_get_bytes_per_pixel(vs->ds); guest_row = vs->guest.ds->data; server_row = vs->server.ds->data; for (y = 0; y < vs->guest.ds->height; y++) { |