[gtk-vnc] Fix inverted endianness when setting pixel format



commit 1e8e4949310412da8105b0d2c84e4a1cce668b87
Author: Daniel P. Berrange <berrange redhat com>
Date:   Tue Aug 16 16:40:49 2016 +0100

    Fix inverted endianness when setting pixel format
    
    Least-significant-byte first corresponds to little endian,
    not big endian. This problem was exposed when we started
    setting pixel format in
    
      commit d8adb75e926872792b57a7ece5ce7d8cf2c2d8bc
      Author: Daniel P. Berrange <berrange redhat com>
      Date:   Fri Apr 25 17:30:12 2014 +0100
    
        Always send back pixel format message
    
    but only if disabling the tight encoding.
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncdisplay.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 070ab6c..458d8ab 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1403,9 +1403,9 @@ static gboolean vnc_display_set_preferred_pixel_format(VncDisplay *display)
     }
 
 #if GTK_CHECK_VERSION (2, 21, 1)
-    fmt.byte_order = gdk_visual_get_byte_order (v) == GDK_LSB_FIRST ? G_BIG_ENDIAN : G_LITTLE_ENDIAN;
+    fmt.byte_order = gdk_visual_get_byte_order (v) == GDK_LSB_FIRST ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
 #else
-    fmt.byte_order = v->byte_order == GDK_LSB_FIRST ? G_BIG_ENDIAN : G_LITTLE_ENDIAN;
+    fmt.byte_order = v->byte_order == GDK_LSB_FIRST ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
 #endif
 
     VNC_DEBUG ("Set depth color to %d (%d bpp)", fmt.depth, fmt.bits_per_pixel);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]