if compressing less than or equal to 4 bytes the function will return exceptions
version zstd 1.5.4
Windows 10 Pro 21H2 19044.2604
CPU: i7-6700K
Compiler: Visual Studio 2022 (v143)
here is a sample code
int main() {
const size_t srcSize = 4;
char src[srcSize] = {0x0 ,0x0 ,0x0 ,0x0 };
size_t dstSize = srcSize + 12 + max(1, (srcSize + 12) / 1000);
char* dst = new char[dstSize];
size_t const countSize = ZSTD_compress((void*)dst, dstSize, (const void*)src, srcSize, 3);
if (ZSTD_isError(countSize)) {
assert(!ZSTD_isError(countSize));
}
}