Skip to content

Commit bb1ced4

Browse files
committed
Fix bound check
1 parent c02a7d7 commit bb1ced4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transform/LZCodec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bool LZXCodec<T>::forward(SliceArray<byte>& input, SliceArray<byte>& output, int
121121
int bestLen = 0;
122122

123123
if (memcmp(&src[srcIdx], &src[ref], 4) == 0) {
124-
bestLen = 4 + findMatch(src, srcIdx + 4, ref + 4, min(srcEnd - srcIdx, MAX_MATCH));
124+
bestLen = 4 + findMatch(src, srcIdx + 4, ref + 4, min(srcEnd - srcIdx - 4, MAX_MATCH));
125125
}
126126

127127
// No good match ?

0 commit comments

Comments
 (0)