From: Yann Collet Date: Mon, 3 Jul 2017 20:47:46 +0000 (-0700) Subject: fixed gz error reporting X-Git-Tag: v1.3.0~1^2~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=368b97438732915fc437229a9ee7e811530828a7;p=thirdparty%2Fzstd.git fixed gz error reporting --- diff --git a/programs/fileio.c b/programs/fileio.c index 1d98e474a..2557c08e8 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1679,9 +1679,9 @@ static int FIO_decompressFrames(dRess_t ress, FILE* srcFile, } if (buf[0] == 31 && buf[1] == 139) { /* gz magic number */ #ifdef ZSTD_GZDECOMPRESS - unsigned long long const result = FIO_decompressGzFrame(&ress, srcFile, srcFileName); - if (result == 0) return 1; - filesize += result; + unsigned long long const frameSize = FIO_decompressGzFrame(&ress, srcFile, srcFileName); + if (frameSize == FIO_ERROR_FRAME_DECODING) return 1; + filesize += frameSize; #else DISPLAYLEVEL(1, "zstd: %s: gzip file cannot be uncompressed (zstd compiled without HAVE_ZLIB) -- ignored \n", srcFileName); return 1;