diff --git a/WHATS_NEW b/WHATS_NEW index 0ce76562a..66cc76616 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.84 - =================================== + Fix CRC32 calculation on big endian CPU (2.02.75). Version 2.02.83 - 4th February 2011 =================================== diff --git a/lib/misc/crc.c b/lib/misc/crc.c index 9f95c37b7..c948b7753 100644 --- a/lib/misc/crc.c +++ b/lib/misc/crc.c @@ -16,6 +16,7 @@ #include "lib.h" #include "crc.h" +#include "xlate.h" /* Calculate an endian-independent CRC of supplied buffer */ #ifndef DEBUG_CRC32 @@ -65,7 +66,7 @@ static uint32_t _calc_crc_new(uint32_t initial, const uint8_t *buf, uint32_t siz /* Process 4 bytes per iteration */ while (start < end) { - crc = crc ^ *start++; + crc = crc ^ xlate32(*start++); crc = crctab[crc & 0xff] ^ crc >> 8; crc = crctab[crc & 0xff] ^ crc >> 8; crc = crctab[crc & 0xff] ^ crc >> 8;