mirror of
https://github.com/facebook/zstd.git
synced 2024-12-20 01:13:32 +08:00
fixed wrong assertion
base can actually overflow
This commit is contained in:
parent
0d7626672d
commit
99ddca43a6
@ -2003,7 +2003,6 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
|
||||
{ const BYTE* const base = ms->window.base;
|
||||
const BYTE* const istart = (const BYTE*)src;
|
||||
const U32 current = (U32)(istart-base);
|
||||
assert(istart >= base);
|
||||
if (sizeof(ptrdiff_t)==8) assert(istart - base < (ptrdiff_t)(U32)(-1)); /* ensure no overflow */
|
||||
if (current > ms->nextToUpdate + 384)
|
||||
ms->nextToUpdate = current - MIN(192, (U32)(current - ms->nextToUpdate - 384));
|
||||
|
Loading…
Reference in New Issue
Block a user