From: Danielle Rozenblit Date: Mon, 17 Oct 2022 18:24:24 +0000 (-0700) Subject: Merge X-Git-Tag: v1.5.4^2~66^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4f0d364affdc69709ba464fa910b35bf1374aae;p=thirdparty%2Fzstd.git Merge --- b4f0d364affdc69709ba464fa910b35bf1374aae diff --cc lib/compress/huf_compress.c index d8bbaa6b4,e94b398da..b6905d3a6 --- a/lib/compress/huf_compress.c +++ b/lib/compress/huf_compress.c @@@ -1258,8 -1255,8 +1255,9 @@@ unsigned HUF_minTableLog(unsigned symbo unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void* workSpace, size_t wkspSize, HUF_CElt* table, const unsigned* count, HUF_depth_mode depthMode) { - unsigned optLog = FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1); + unsigned optLogGuess = FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1); + unsigned optLog = optLogGuess; + assert(srcSize > 1); /* Not supported, RLE should be used instead */ if (depthMode == HUF_depth_optimal) { /** Test valid depths and return optimal **/ BYTE* dst = (BYTE*)workSpace + sizeof(HUF_WriteCTableWksp);