mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
multi-files -t doesn't stop after detecting magic number read failure
This commit is contained in:
parent
a1dd6b97d2
commit
fbd557d5c2
1 changed files with 2 additions and 2 deletions
|
|
@ -698,11 +698,11 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* srcFileName)
|
|||
size_t const toRead = 4;
|
||||
size_t const sizeCheck = fread(ress.srcBuffer, (size_t)1, toRead, srcFile);
|
||||
if (sizeCheck==0) {
|
||||
if (readSomething==0) { DISPLAY("zstd: %s: unexpected end of file\n", srcFileName); return 1; } /* srcFileName is empty */
|
||||
if (readSomething==0) { DISPLAY("zstd: %s: unexpected end of file \n", srcFileName); fclose(srcFile); return 1; } /* srcFileName is empty */
|
||||
break; /* no more input */
|
||||
}
|
||||
readSomething = 1;
|
||||
if (sizeCheck != toRead) EXM_THROW(31, "zstd: %s read error : cannot read header", srcFileName);
|
||||
if (sizeCheck != toRead) { DISPLAY("zstd: %s: unknown header \n", srcFileName); fclose(srcFile); return 1; } /* srcFileName is empty */
|
||||
{ U32 const magic = MEM_readLE32(ress.srcBuffer);
|
||||
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||
if (ZSTD_isLegacy(ress.srcBuffer, 4)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue