ui: fix setting client_endian field defaults
When a VNC client sends a "set pixel format" message, the 'client_endian' field will get initialized, however, it is valid to omit this message if the client wants to use the server's native pixel format. In the latter scenario nothing is initializing the 'client_endian' field, so it remains set to 0, matching neither G_LITTLE_ENDIAN nor G_BIG_ENDIAN. This then results in pixel format conversion routines taking the wrong code paths. This problem existed before the 'client_be' flag was changed into the 'client_endian' value, but the lack of initialization meant it semantically defaulted to little endian, so only big endian systems would potentially be exposed to incorrect pixel translation. The 'virt-viewer' / 'remote-viewer' apps always send a "set pixel format" message so aren't exposed to any problems, but the classical 'vncviewer' app will show the problem easily. Fixes:7ed96710e8Reported-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> (cherry picked from commit3ac6daa9e1) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
9561a8c140
commit
08fa61a365
1 changed files with 1 additions and 0 deletions
1
ui/vnc.c
1
ui/vnc.c
|
|
@ -2336,6 +2336,7 @@ static void pixel_format_message (VncState *vs) {
|
|||
char pad[3] = { 0, 0, 0 };
|
||||
|
||||
vs->client_pf = qemu_default_pixelformat(32);
|
||||
vs->client_endian = G_BYTE_ORDER;
|
||||
|
||||
vnc_write_u8(vs, vs->client_pf.bits_per_pixel); /* bits-per-pixel */
|
||||
vnc_write_u8(vs, vs->client_pf.depth); /* depth */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue