Skip to contentSkip to conversation

Fix incorrect attempt to clear a flag in vnc.c

PATCH Applied Brian Kress 4 participants 4 messages Feb 14, 2009 – Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix incorrect attempt to clear a flag in vnc.c

In vnc.c in pixel_format_message, the code tries to clear the QEMU_ALLOCATED_FLAG from the client display surface, however it uses the wrong operator and ends up enabling all other flags. Most notably this enables the big endian flag and causes some chaos.

vnc.c +1 -1
Index: vnc.c
===================================================================
@@ -1421,7 +1421,7 @@
     else if (vs->ds->surface->pf.bits_per_pixel == 8)
         vs->send_hextile_tile = send_hextile_tile_8;
     vs->clientds = *(vs->ds->surface);
-    vs->clientds.flags |= ~QEMU_ALLOCATED_FLAG;
+    vs->clientds.flags &= ~QEMU_ALLOCATED_FLAG;
     vs->write_pixels = vnc_write_pixels_copy;
 
     vnc_write(vs, pad, 3);           /* padding */
#1 lore raw
Quoted 3 lines · Brian Kress

In vnc.c in pixel_format_message, the code tries to clear the QEMU_ALLOCATED_FLAG from the client display surface, however it uses the wrong operator and ends up enabling all other flags. Most notably this enables the big endian flag and causes some chaos.

Can you add a Signed-off-by line?

Regards,

Anthony Liguori

#2 lore raw
Quoted 6 lines · Anthony Liguori
Quoted 3 lines · Brian Kress

In vnc.c in pixel_format_message, the code tries to clear the QEMU_ALLOCATED_FLAG from the client display surface, however it uses the wrong operator and ends up enabling all other flags. Most notably this enables the big endian flag and causes some chaos.

Can you add a Signed-off-by line?

vnc.c +1 -1
Index: vnc.c
===================================================================
@@ -1421,7 +1421,7 @@
    else if (vs->ds->surface->pf.bits_per_pixel == 8)
        vs->send_hextile_tile = send_hextile_tile_8;
    vs->clientds = *(vs->ds->surface);
-    vs->clientds.flags |= ~QEMU_ALLOCATED_FLAG;
+    vs->clientds.flags &= ~QEMU_ALLOCATED_FLAG;
    vs->write_pixels = vnc_write_pixels_copy;
 
    vnc_write(vs, pad, 3);           /* padding */
#3 lore raw
Quoted 11 lines · Brian Kress
Quoted 9 lines · Anthony Liguori
Quoted 6 lines · Brian Kress

In vnc.c in pixel_format_message, the code tries to clear the QEMU_ALLOCATED_FLAG
from the client display surface, however it uses the wrong operator and ends up enabling all
other flags. Most notably this enables the big endian flag and causes some chaos.

Can you add a Signed-off-by line?

Thanks, applied.

Quoted 17 lines

Index: vnc.c
===================================================================

vnc.c +1 -1
@@ -1421,7 +1421,7 @@
    else if (vs->ds->surface->pf.bits_per_pixel == 8)
        vs->send_hextile_tile = send_hextile_tile_8;
    vs->clientds = *(vs->ds->surface);
-    vs->clientds.flags |= ~QEMU_ALLOCATED_FLAG;
+    vs->clientds.flags &= ~QEMU_ALLOCATED_FLAG;
    vs->write_pixels = vnc_write_pixels_copy;
 
    vnc_write(vs, pad, 3);           /* padding */
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net