mirror of
https://github.com/facebook/zstd.git
synced 2025-11-28 00:04:28 -05:00
Merge pull request #1244 from terrelln/ferror
fileio: Error in compression on read errors
This commit is contained in:
commit
545bd3dd01
@ -797,6 +797,14 @@ FIO_compressZstdFrame(const cRess_t* ressPtr,
|
||||
}
|
||||
} while (directive != ZSTD_e_end);
|
||||
|
||||
if (ferror(srcFile)) {
|
||||
EXM_THROW(26, "Read error : I/O error");
|
||||
}
|
||||
if (fileSize != UTIL_FILESIZE_UNKNOWN && *readsize != fileSize) {
|
||||
EXM_THROW(27, "Read error : Incomplete read : %llu / %llu B",
|
||||
(unsigned long long)*readsize, (unsigned long long)fileSize);
|
||||
}
|
||||
|
||||
return compressedfilesize;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user