From: senhuang42 Date: Thu, 29 Oct 2020 18:49:37 +0000 (-0400) Subject: Correct literalsRead calculation to include longLength X-Git-Tag: v1.4.7~39^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69bd5f065461535fb9718cbe6804a82afd2a67ba;p=thirdparty%2Fzstd.git Correct literalsRead calculation to include longLength --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 93bfed4da..f18880cab 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2456,7 +2456,6 @@ static void ZSTD_copyBlockSequences(ZSTD_CCtx* zc) /* Ensure we have enough space for last literals "sequence" */ assert(zc->seqCollector.maxSequences >= seqStoreSeqSize + 1); for (i = 0; i < seqStoreSeqSize; ++i) { - literalsRead += seqStoreSeqs[i].litLength; outSeqs[i].litLength = seqStoreSeqs[i].litLength; outSeqs[i].matchLength = seqStoreSeqs[i].matchLength + MINMATCH; @@ -2487,6 +2486,7 @@ static void ZSTD_copyBlockSequences(ZSTD_CCtx* zc) } else { outSeqs[i].offset = seqStoreSeqs[i].offset - ZSTD_REP_NUM; } + literalsRead += outSeqs[i].litLength; } /* Insert last literals (if any exist) in the block as a sequence with ml == off == 0 */