From: Lucinda May Phipps Date: Fri, 13 May 2022 07:48:17 +0000 (+0100) Subject: crc32_acle.c: make logic more consistent X-Git-Tag: 2.1.0-beta1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fac5a348402c2bd7fc273dda7613a94c1e469eb;p=thirdparty%2Fzlib-ng.git crc32_acle.c: make logic more consistent --- diff --git a/arch/arm/crc32_acle.c b/arch/arm/crc32_acle.c index 68cdafa31..db730e246 100644 --- a/arch/arm/crc32_acle.c +++ b/arch/arm/crc32_acle.c @@ -22,7 +22,7 @@ uint32_t crc32_acle(uint32_t crc, const uint8_t *buf, uint64_t len) { len--; } - if ((len > sizeof(uint16_t)) && ((ptrdiff_t)buf & sizeof(uint16_t))) { + if ((len >= sizeof(uint16_t)) && ((ptrdiff_t)buf & sizeof(uint16_t))) { buf2 = (const uint16_t *) buf; c = __crc32h(c, *buf2++); len -= sizeof(uint16_t); @@ -32,7 +32,7 @@ uint32_t crc32_acle(uint32_t crc, const uint8_t *buf, uint64_t len) { } #if defined(__aarch64__) - if ((len > sizeof(uint32_t)) && ((ptrdiff_t)buf & sizeof(uint32_t))) { + if ((len >= sizeof(uint32_t)) && ((ptrdiff_t)buf & sizeof(uint32_t))) { c = __crc32w(c, *buf4++); len -= sizeof(uint32_t); }