From: Yann Collet Date: Fri, 17 Jul 2020 03:33:50 +0000 (-0700) Subject: ensure workspace is large enough X-Git-Tag: v1.4.7~110^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c224367edec9052d22af101034d69bcecb22bcb7;p=thirdparty%2Fzstd.git ensure workspace is large enough even when MAX_TABLELOG is reduced --- diff --git a/lib/compress/fse_compress.c b/lib/compress/fse_compress.c index a42759814..5290a918b 100644 --- a/lib/compress/fse_compress.c +++ b/lib/compress/fse_compress.c @@ -678,7 +678,10 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src typedef struct { FSE_CTable CTable_max[FSE_CTABLE_SIZE_U32(FSE_MAX_TABLELOG, FSE_MAX_SYMBOL_VALUE)]; - BYTE scratchBuffer[1 << FSE_MAX_TABLELOG]; + union { + U32 hist_wksp[HIST_WKSP_SIZE_U32]; + BYTE scratchBuffer[1 << FSE_MAX_TABLELOG]; + } workspace; } fseWkspMax_t; size_t FSE_compress2 (void* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog)