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;