fixed wrong assertion
base can actually overflow
This commit is contained in:
@@ -2003,7 +2003,6 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
|
|||||||
{ const BYTE* const base = ms->window.base;
|
{ const BYTE* const base = ms->window.base;
|
||||||
const BYTE* const istart = (const BYTE*)src;
|
const BYTE* const istart = (const BYTE*)src;
|
||||||
const U32 current = (U32)(istart-base);
|
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 (sizeof(ptrdiff_t)==8) assert(istart - base < (ptrdiff_t)(U32)(-1)); /* ensure no overflow */
|
||||||
if (current > ms->nextToUpdate + 384)
|
if (current > ms->nextToUpdate + 384)
|
||||||
ms->nextToUpdate = current - MIN(192, (U32)(current - ms->nextToUpdate - 384));
|
ms->nextToUpdate = current - MIN(192, (U32)(current - ms->nextToUpdate - 384));
|
||||||
|
|||||||
Reference in New Issue
Block a user