]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Update zstd_compress.c 3148/head
authorihsinme <ihsinme@gmail.com>
Mon, 30 May 2022 11:08:19 +0000 (14:08 +0300)
committerGitHub <noreply@github.com>
Mon, 30 May 2022 11:08:19 +0000 (14:08 +0300)
lib/compress/zstd_compress.c

index e43bbec44fcc7c4a26595c72ab674292bda547db..f60fb4351d88ae1cb467533fa17e88643051caee 100644 (file)
@@ -5873,7 +5873,7 @@ ZSTD_copySequencesToSeqStoreExplicitBlockDelim(ZSTD_CCtx* cctx,
         dictSize = 0;
     }
     ZSTD_memcpy(updatedRepcodes.rep, cctx->blockState.prevCBlock->rep, sizeof(repcodes_t));
-    for (; (inSeqs[idx].matchLength != 0 || inSeqs[idx].offset != 0) && idx < inSeqsSize; ++idx) {
+    for (; idx < inSeqsSize && (inSeqs[idx].matchLength != 0 || inSeqs[idx].offset != 0); ++idx) {
         U32 const litLength = inSeqs[idx].litLength;
         U32 const ll0 = (litLength == 0);
         U32 const matchLength = inSeqs[idx].matchLength;