[Spice-devel] [spice-common][PATCH 1/2] ppc: Deal with lz magic endianess

Fabiano FidĂȘncio fidencio at redhat.com
Mon May 18 06:10:57 PDT 2015


Since commit d39dfbfe lz magic is always treated as LE when encoded.
Treating it as a LE when decoding is now necessary as well.
---
 common/lz.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/lz.c b/common/lz.c
index 2350152..8698159 100644
--- a/common/lz.c
+++ b/common/lz.c
@@ -603,7 +603,8 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
         encoder->usr->error(encoder->usr, "io reset failed");
     }
 
-    magic = decode_32(encoder);
+    magic = GUINT32_FROM_LE(decode_32(encoder));
+
     if (magic != LZ_MAGIC) {
         encoder->usr->error(encoder->usr, "bad magic\n");
     }
-- 
2.4.0



More information about the Spice-devel mailing list