fixed 0-seq blocks in block-decompression mode

This commit is contained in:
Yann Collet 2018-03-06 01:50:19 -08:00
parent 9a91afe6ef
commit 06ca9c7d7c

View File

@ -1331,7 +1331,8 @@ static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
ip += seqHSize;
srcSize -= seqHSize;
if (dctx->fParams.windowSize > (1<<24)) {
if ( (dctx->fParams.windowSize > (1<<24) || !frame)
&& (nbSeq>0) ) { /* could probably use a larger nbSeq limit */
U32 const shareLongOffsets = ZSTD_getLongOffsetsShare(dctx->OFTptr);
U32 const minShare = MEM_64bits() ? 7 : 20;
if (shareLongOffsets >= minShare)