diff --git a/crc.cpp b/crc.cpp index 0ddfe448..77a21ca9 100644 --- a/crc.cpp +++ b/crc.cpp @@ -124,12 +124,12 @@ CRC32::CRC32() void CRC32::Update(const byte *s, size_t n) { - assert(IsAlignedOn(s,GetAlignmentOf())); word32 crc = m_crc; for(; !IsAligned(s) && n > 0; n--) crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc); + assert((n && IsAlignedOn(s,GetAlignmentOf())) || !n); while (n >= 4) { crc ^= *(const word32 *)(void*)s;