]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
gzip : only display inflateEnd error when there is no error before
authorYann Collet <cyan@fb.com>
Mon, 3 Jul 2017 20:45:09 +0000 (13:45 -0700)
committerYann Collet <cyan@fb.com>
Mon, 3 Jul 2017 20:45:09 +0000 (13:45 -0700)
programs/fileio.c

index 94c629303f9e05513a906323c190e922721173b1..1d98e474a8749cccdfce79a3b0cb205376f58a36 100644 (file)
@@ -1483,7 +1483,8 @@ static unsigned long long FIO_decompressGzFrame(dRess_t* ress,
 
     if (strm.avail_in > 0) memmove(ress->srcBuffer, strm.next_in, strm.avail_in);
     ress->srcBufferLoaded = strm.avail_in;
-    if (inflateEnd(&strm) != Z_OK) {
+    if ( (inflateEnd(&strm) != Z_OK)  /* release resources ; error detected */
+      && (decodingError==0) ) {
         DISPLAYLEVEL(1, "zstd: %s: inflateEnd error \n", srcFileName);
         decodingError = 1;
     }