]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed : premature frame end on zero-sized raw block - reported by @ebiggers
authorYann Collet <yann.collet.73@gmail.com>
Sun, 17 Jul 2016 13:39:24 +0000 (15:39 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Sun, 17 Jul 2016 13:39:24 +0000 (15:39 +0200)
lib/decompress/zstd_decompress.c

index a48c9abdfdb3c1b570c319ba121d144ab4cba8cf..7ccfb963d358ab8c98b004be66309e6352b5847d 100644 (file)
@@ -1013,7 +1013,7 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx,
         default:
             return ERROR(GENERIC);   /* impossible */
         }
-        if (cBlockSize == 0) break;   /* bt_end */
+        if (blockProperties.blockType == bt_end) break;   /* bt_end */
 
         if (ZSTD_isError(decodedSize)) return decodedSize;
         if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, op, decodedSize);