From bdf97c30e3ae18e5a5d69fe2204a1680e24b18ba Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Tue, 4 Feb 2014 15:45:31 +0100 Subject: [PATCH] Fix buggy foug_decode_uint32_me() --- src/internal/byte_codec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/byte_codec.h b/src/internal/byte_codec.h index 86adf3c..51337c1 100644 --- a/src/internal/byte_codec.h +++ b/src/internal/byte_codec.h @@ -39,7 +39,7 @@ FOUG_INLINE static uint32_t foug_decode_uint32_le(const uint8_t* bytes) FOUG_INLINE static uint32_t foug_decode_uint32_me(const uint8_t* bytes) { /* |DD|CC|BB|AA| -> 0xCCDDAABB */ - return (bytes[0] >> 8) | (bytes[2] << 8) | (bytes[3] << 8) | (bytes[1] << 8); + return (bytes[0] << 16) | (bytes[1] << 24) | (bytes[3] << 8) | bytes[2]; } /*! Read a 32bit integer from memory-location \p bytes (big-endian byte order) */