]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix incorrect assert
authorYann Collet <yann.collet.73@gmail.com>
Fri, 6 Nov 2020 17:44:04 +0000 (09:44 -0800)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 6 Nov 2020 17:44:04 +0000 (09:44 -0800)
fix #2386, reported by @Neumann-A

lib/decompress/zstd_decompress.c

index 61a6c5134b2f5b016f4a46401b6ff4d3d9ab11eb..52a0d0e651b332a3b2786a139b02359d54f89d71 100644 (file)
@@ -732,7 +732,7 @@ static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,
             decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
             if (ZSTD_isError(decodedSize)) return decodedSize;
 
-            assert(decodedSize <=- dstCapacity);
+            assert(decodedSize <= dstCapacity);
             dst = (BYTE*)dst + decodedSize;
             dstCapacity -= decodedSize;
 
@@ -1571,7 +1571,7 @@ static void ZSTD_DCtx_updateOversizedDuration(ZSTD_DStream* zds, size_t const ne
 {
     if (ZSTD_DCtx_isOverflow(zds, neededInBuffSize, neededOutBuffSize))
         zds->oversizedDuration++;
-    else 
+    else
         zds->oversizedDuration = 0;
 }
 
@@ -1778,7 +1778,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
 
                 {   int const tooSmall = (zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize);
                     int const tooLarge = ZSTD_DCtx_isOversizedTooLong(zds);
-                    
+
                     if (tooSmall || tooLarge) {
                         size_t const bufferSize = neededInBuffSize + neededOutBuffSize;
                         DEBUGLOG(4, "inBuff  : from %u to %u",