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