From: W. Felix Handte Date: Wed, 11 Sep 2019 21:03:09 +0000 (-0400) Subject: Shrink Table Valid End During Alloc Alignment / Phase Change X-Git-Tag: v1.4.4~1^2~49^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20c69077d1ce197cb6cf7f1bf8f581fb98607b71;p=thirdparty%2Fzstd.git Shrink Table Valid End During Alloc Alignment / Phase Change --- diff --git a/lib/compress/zstd_cwksp.h b/lib/compress/zstd_cwksp.h index 98499b86f..39d064c49 100644 --- a/lib/compress/zstd_cwksp.h +++ b/lib/compress/zstd_cwksp.h @@ -184,6 +184,9 @@ MEM_STATIC void ZSTD_cwksp_internal_advance_phase( * by a larger margin than the space that will be consumed. */ /* TODO: cleaner, compiler warning friendly way to do this??? */ ws->allocStart = (BYTE*)ws->allocStart - ((size_t)ws->allocStart & (sizeof(U32)-1)); + if (ws->allocStart < ws->tableValidEnd) { + ws->tableValidEnd = ws->allocStart; + } } ws->phase = phase; }