This commit is contained in:
Nikita Mikhaylov 2021-08-16 12:30:02 +00:00
parent 750e35a454
commit d25d12d7d4

View File

@ -439,11 +439,14 @@ bool NO_INLINE decompressImpl(
{
s = *ip++;
length += s;
} while (unlikely(s == 255));
} while (ip < input_end && unlikely(s == 255));
};
/// Get literal length.
if (unlikely(ip >= input_end))
return false;
const unsigned token = *ip++;
length = token >> 4;
if (length == 0x0F)
@ -475,7 +478,7 @@ bool NO_INLINE decompressImpl(
ip += length;
op = copy_end;
if (unlikely(ip > input_end))
if (unlikely(ip + 1 >= input_end))
return false;
/// Get match offset.