mirror of
https://github.com/facebook/zstd.git
synced 2025-08-01 09:47:01 +03:00
test for fail to decompress
This commit is contained in:
@ -78,10 +78,14 @@ static void decompress(const char* fname, const ZSTD_DDict* ddict)
|
||||
size_t cSize;
|
||||
void* const cBuff = loadFile_orDie(fname, &cSize);
|
||||
unsigned long long const rSize = ZSTD_findDecompressedSize(cBuff, cSize);
|
||||
if (rSize==ZSTD_CONTENTSIZE_UNKNOWN) {
|
||||
if (rSize==ZSTD_CONTENTSIZE_ERROR) {
|
||||
fprintf(stderr, "%s : it was not compressed by zstd.\n", fname);
|
||||
exit(5);
|
||||
} else if (rSize==ZSTD_CONTENTSIZE_UNKNOWN) {
|
||||
fprintf(stderr, "%s : original size unknown \n", fname);
|
||||
exit(6);
|
||||
}
|
||||
|
||||
void* const rBuff = malloc_orDie((size_t)rSize);
|
||||
|
||||
ZSTD_DCtx* const dctx = ZSTD_createDCtx();
|
||||
|
Reference in New Issue
Block a user