1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

Merge pull request #2890 from 15596858998/dec_1201

fixbug CLI's -D fails when the argument is not a regular file
This commit is contained in:
Nick Terrell
2021-12-06 13:18:15 -05:00
committed by GitHub

View File

@ -742,6 +742,8 @@ static size_t FIO_createDictBuffer(void** bufferPtr, const char* fileName, FIO_p
if (fileHandle==NULL) EXM_THROW(31, "%s: %s", fileName, strerror(errno));
fileSize = UTIL_getFileSize(fileName);
if (fileSize == UTIL_FILESIZE_UNKNOWN)
EXM_THROW(32, "This file format is not supported : Dictionary file %s\n", fileName);
{
size_t const dictSizeMax = prefs->patchFromMode ? prefs->memLimit : DICTSIZE_MAX;
if (fileSize > dictSizeMax) {