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.0.7~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a636726a3945175073ccab8def49e7e8f4aa9186;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 88ba6c38..383c61f1 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 unsigned char *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 unsigned char *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); }