Commit 4043a013 authored by Corentin Chary's avatar Corentin Chary Committed by Anthony Liguori
Browse files

vnc: tight: fix rgb_prepare_row



rgb_prepare_row bpp depends on the server display surface, not
the client.

Signed-off-by: default avatarCorentin Chary <corentincj@iksaif.net>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent d01f9595
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -1180,13 +1180,18 @@ DEFINE_RGB_GET_ROW_FUNCTION(32)
static void rgb_prepare_row(VncState *vs, uint8_t *dst, int x, int y,
                            int count)
{
    if (vs->tight.pixel24)
    if (ds_get_bytes_per_pixel(vs->ds) == 4) {
        if (vs->ds->surface->pf.rmax == 0xFF &&
            vs->ds->surface->pf.gmax == 0xFF &&
            vs->ds->surface->pf.bmax == 0xFF) {
            rgb_prepare_row24(vs, dst, x, y, count);
    else if (ds_get_bytes_per_pixel(vs->ds) == 4)
        } else {
            rgb_prepare_row32(vs, dst, x, y, count);
    else
        }
    } else {
        rgb_prepare_row16(vs, dst, x, y, count);
    }
}
#endif /* CONFIG_VNC_JPEG or CONFIG_VNC_PNG */

/*