diff --git a/lib/common/fse.h b/lib/common/fse.h index 1c44f8375..afd780196 100644 --- a/lib/common/fse.h +++ b/lib/common/fse.h @@ -184,7 +184,7 @@ FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize, const sh /*! Constructor and Destructor of FSE_CTable. Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */ typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */ -FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned tableLog, unsigned maxSymbolValue); +FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog); FSE_PUBLIC_API void FSE_freeCTable (FSE_CTable* ct); /*! FSE_buildCTable(): diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index d234903b5..892912f2e 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -649,8 +649,8 @@ ZSTD_compressionParameters ZSTD_adjustCParams_internal(ZSTD_compressionParameter if (dictSize && (srcSize+1<2) /* srcSize unknown */ ) srcSize = minSrcSize; /* presumed small when there is a dictionary */ - else - srcSize -= 1; /* unknown 0 => -1ULL : presumed large */ + else if (srcSize == 0) + srcSize = ZSTD_CONTENTSIZE_UNKNOWN; /* 0 == unknown : presumed large */ /* resize windowLog if input is small enough, to use less memory */ if ( (srcSize < maxWindowResize)