]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix Off-By-One Error
authorW. Felix Handte <w@felixhandte.com>
Wed, 23 May 2018 20:45:58 +0000 (16:45 -0400)
committerW. Felix Handte <w@felixhandte.com>
Fri, 25 May 2018 17:13:28 +0000 (13:13 -0400)
lib/compress/zstd_double_fast.c

index 711bf41abe1b56e6eb35339daa133bd1fab0b6d3..b862289bb45e21507087d1d5a7b66467b7f0841a 100644 (file)
@@ -169,7 +169,7 @@ size_t ZSTD_compressBlock_doubleFast_generic(
                     U32 const dictMatchIndexL3 = dictHashLong[hl3];
                     const BYTE* dictMatchL3 = dictBase + dictMatchIndexL3;
                     assert(dictMatchL3 < dictEnd);
-                    if (dictMatchL3 > dictLowest && MEM_read64(dictMatchL3) == MEM_read64(ip)) {
+                    if (dictMatchL3 > dictLowest && MEM_read64(dictMatchL3) == MEM_read64(ip+1)) {
                         mLength = ZSTD_count_2segments(ip+1+8, dictMatchL3+8, iend, dictEnd, prefixLowest) + 8;
                         ip++;
                         offset = (U32)(current + 1 - dictMatchIndexL3 - dictIndexDelta);