* significantly faster. Process leading bytes so that the loop below
* starts with a pointer aligned to eight bytes.
*/
- if (!PointerIsAligned(p, uint16) && p < pend)
+ if (!PointerIsAligned(p, uint16) && p + 1 <= pend)
{
crc = __crc32cb(crc, *p);
p += 1;
}
- if (!PointerIsAligned(p, uint32) && p < pend)
+ if (!PointerIsAligned(p, uint32) && p + 2 <= pend)
{
crc = __crc32ch(crc, *(uint16 *) p);
p += 2;
}
- if (!PointerIsAligned(p, uint64) && p < pend)
+ if (!PointerIsAligned(p, uint64) && p + 4 <= pend)
{
crc = __crc32cw(crc, *(uint32 *) p);
p += 4;