From: senhuang42 Date: Fri, 2 Oct 2020 17:47:54 +0000 (-0400) Subject: Add explicit conversion of size_t to U32 X-Git-Tag: v1.4.7~57^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8b43a42023ee5bdbc1f093d4d418aad00b443cc;p=thirdparty%2Fzstd.git Add explicit conversion of size_t to U32 --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 5211fc917..dcd9e1929 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -784,7 +784,7 @@ static void ZSTD_opt_skipBytesInLdmSeqStore(rawSeqStore_t* ldmSeqStore, size_t n ldmSeqStore->posInSequence += currSeq.litLength; nbBytes -= currSeq.litLength; } - + if (nbBytes < currSeq.matchLength) { ldmSeqStore->posInSequence += nbBytes; return; @@ -823,10 +823,10 @@ static void ZSTD_opt_getNextLdmAndUpdateSeqStore(rawSeqStore_t* ldmSeqStore, assert(ldmSeqStore->posInSequence <= currSeq.litLength + currSeq.matchLength); currBlockEndPos = currPosInBlock + blockBytesRemaining; literalsBytesRemaining = (ldmSeqStore->posInSequence < currSeq.litLength) ? - currSeq.litLength - ldmSeqStore->posInSequence : + currSeq.litLength - (U32)ldmSeqStore->posInSequence : 0; matchBytesRemaining = (literalsBytesRemaining == 0) ? - currSeq.matchLength - (ldmSeqStore->posInSequence - currSeq.litLength) : + currSeq.matchLength - ((U32)ldmSeqStore->posInSequence - currSeq.litLength) : currSeq.matchLength; /* If there are more literal bytes than bytes remaining in block, no ldm is possible */