File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1816,18 +1816,22 @@ static void set_pixel_format(VncState *vs,
1816
1816
}
1817
1817
1818
1818
vs -> clientds = * (vs -> vd -> guest .ds );
1819
- vs -> clientds .pf .rmax = red_max ;
1819
+
1820
+ vs -> clientds .pf .rmax = red_max != 0 ? red_max : 0xff ;
1820
1821
count_bits (vs -> clientds .pf .rbits , red_max );
1821
1822
vs -> clientds .pf .rshift = red_shift ;
1822
1823
vs -> clientds .pf .rmask = red_max << red_shift ;
1823
- vs -> clientds .pf .gmax = green_max ;
1824
+
1825
+ vs -> clientds .pf .gmax = green_max != 0 ? green_max : 0xff ;
1824
1826
count_bits (vs -> clientds .pf .gbits , green_max );
1825
1827
vs -> clientds .pf .gshift = green_shift ;
1826
1828
vs -> clientds .pf .gmask = green_max << green_shift ;
1827
- vs -> clientds .pf .bmax = blue_max ;
1829
+
1830
+ vs -> clientds .pf .bmax = blue_max != 0 ? blue_max : 0xff ;
1828
1831
count_bits (vs -> clientds .pf .bbits , blue_max );
1829
1832
vs -> clientds .pf .bshift = blue_shift ;
1830
1833
vs -> clientds .pf .bmask = blue_max << blue_shift ;
1834
+
1831
1835
vs -> clientds .pf .bits_per_pixel = bits_per_pixel ;
1832
1836
vs -> clientds .pf .bytes_per_pixel = bits_per_pixel / 8 ;
1833
1837
vs -> clientds .pf .depth = bits_per_pixel == 32 ? 24 : bits_per_pixel ;
You can’t perform that action at this time.
0 commit comments