From 8d8800229c106e3b96ee4ac86d1bd9a75370ceb6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2020 19:27:14 +0200 Subject: [PATCH] (libchdr) Backport https://github.com/rtissera/libchdr/blob/16eae7e4e540a873b22cb5c7c0a6302628543ff3/src/chd.c --- libretro-common/formats/libchdr/libchdr_chd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libretro-common/formats/libchdr/libchdr_chd.c b/libretro-common/formats/libchdr/libchdr_chd.c index 570bdd37f9..33aad55455 100644 --- a/libretro-common/formats/libchdr/libchdr_chd.c +++ b/libretro-common/formats/libchdr/libchdr_chd.c @@ -419,12 +419,12 @@ static INLINE UINT32 get_bigendian_uint32(const UINT8 *base) the data stream in bigendian order -------------------------------------------------*/ -static INLINE void put_bigendian_uint24(UINT8 *base, UINT32 value) +static INLINE void put_bigendian_uint32(UINT8 *base, UINT32 value) { - value &= 0xffffff; - base[0] = value >> 16; - base[1] = value >> 8; - base[2] = value; + base[0] = value >> 24; + base[1] = value >> 16; + base[2] = value >> 8; + base[3] = value; } /*------------------------------------------------- @@ -432,7 +432,7 @@ static INLINE void put_bigendian_uint24(UINT8 *base, UINT32 value) the data stream in bigendian order -------------------------------------------------*/ -static INLINE void put_bigendian_uint32(UINT8 *base, UINT32 value) +static INLINE void put_bigendian_uint24(UINT8 *base, UINT32 value) { value &= 0xffffff; base[0] = value >> 16;