<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Spice-gtk crashes when using lz in 16bpp mode on Windows XP"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92820">92820</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Spice-gtk crashes when using lz in 16bpp mode on Windows XP
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Spice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>spice-gtk
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>spice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>lvenhoda@redhat.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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:</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>