[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 7/8] ui/vnc: Add missing lock for send_color_map
From: |
Gerd Hoffmann |
Subject: |
[PULL 7/8] ui/vnc: Add missing lock for send_color_map |
Date: |
Fri, 11 Dec 2020 10:12:49 +0100 |
From: Peng Liang <liangpeng10@huawei.com>
vnc_write() should be locked after the RFB protocol is initialized.
Fixes: 0c426e4534b4 ("vnc: Add support for color map")
Cc: qemu-stable@nongnu.org
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Message-id: 20201116141338.148911-1-liangpeng10@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/vnc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ui/vnc.c b/ui/vnc.c
index 247e80d8f5c8..34e6dc437c0f 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2168,6 +2168,7 @@ static void send_color_map(VncState *vs)
{
int i;
+ vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_SET_COLOUR_MAP_ENTRIES);
vnc_write_u8(vs, 0); /* padding */
vnc_write_u16(vs, 0); /* first color */
@@ -2180,6 +2181,7 @@ static void send_color_map(VncState *vs)
vnc_write_u16(vs, (((i >> pf->gshift) & pf->gmax) << (16 -
pf->gbits)));
vnc_write_u16(vs, (((i >> pf->bshift) & pf->bmax) << (16 -
pf->bbits)));
}
+ vnc_unlock_output(vs);
}
static void set_pixel_format(VncState *vs, int bits_per_pixel,
--
2.27.0
- [PULL 0/8] Ui 20201211 patches, Gerd Hoffmann, 2020/12/11
- [PULL 3/8] vnc: use enum for features, Gerd Hoffmann, 2020/12/11
- [PULL 8/8] sdl2: Add extra mouse buttons, Gerd Hoffmann, 2020/12/11
- [PULL 2/8] console: allow con==NULL in dpy_{get, set}_ui_info and dpy_ui_info_supported, Gerd Hoffmann, 2020/12/11
- [PULL 7/8] ui/vnc: Add missing lock for send_color_map,
Gerd Hoffmann <=
- [PULL 6/8] vnc: add alpha cursor support, Gerd Hoffmann, 2020/12/11
- [PULL 1/8] console: drop qemu_console_get_ui_info, Gerd Hoffmann, 2020/12/11
- [PULL 4/8] vnc: drop unused copyrect feature, Gerd Hoffmann, 2020/12/11
- [PULL 5/8] vnc: add pseudo encodings, Gerd Hoffmann, 2020/12/11
- Re: [PULL 0/8] Ui 20201211 patches, Peter Maydell, 2020/12/11