Bug 92820 - Spice-gtk crashes when using lz in 16bpp mode on Windows XP
Summary: Spice-gtk crashes when using lz in 16bpp mode on Windows XP
Status: RESOLVED FIXED
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: Other Windows (All)
: medium major
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-04 17:26 UTC by Lukas Venhoda
Modified: 2016-04-20 12:16 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Lukas Venhoda 2015-11-04 17:26:31 UTC
All spice-gtk clients (virt-viewer, remote-viewer, spicy and virtmanager) crash, when image compression is set to lz, and guest is set to 16bpp color mode. This was tested on Windows XP.

How to reproduce:
1. Use Windows XP virtual machine.
2. Install QXL driver
3. Set image compression to lz
4. Connect to VM using virt-viewer
5. Set Color Quality to 16bpp
(Right click on the Desktop -> Properties -> Settings -> Color quality)

This issue can be "fixed", when we set lz decoding, to always decode 16bpp image as 32bpp image. Thid could mean, that we send 16bpp image as 32bpp image.

This diff shows what change needs to be done, to "fix" this issue:

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 6f48340..12b285e 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -848,8 +848,8 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, SpiceImage *image,
             as_type = LZ_IMAGE_TYPE_RGB32;
             pixman_format = PIXMAN_x8r8g8b8;
         } else {
-            as_type = LZ_IMAGE_TYPE_RGB16;
-            pixman_format = PIXMAN_x1r5g5b5;
+            as_type = LZ_IMAGE_TYPE_RGB32;
+            pixman_format = PIXMAN_x8r8g8b8;
         }
         break;
     default:
Comment 1 David Jaša 2015-11-26 14:55:58 UTC
Given that you're modifying spice-common to treat 16b images as 32b, does it mean that spice-server with this patch would send 16b images over the wire as 32b as well?
Comment 2 Pavel Grunt 2016-04-14 13:39:23 UTC
Can be reproduced also in Win7 guests, the color depth can be changed by the command line option '--spice-color-depth':

remote-viewer --spice-color-depth=16 --spice-preferred-compression=lz
Comment 3 Frediano Ziglio 2016-04-14 16:58:13 UTC
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1285469


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.