test for fail to decompress
This commit is contained in:
1 parent
44ba42cf22
commit
971c161318
2 files changed
+17
-8
No files matched your search
@@ -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