diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2019-06-14 15:33:04 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-07-18 10:50:06 +0200 |
commit | d4b927b3462711795dde8cd7d787b9dabbf3f3bd (patch) | |
tree | bb2a4c8a5b37ea7a6979d8c613c7c0c02a16095b /deflate_medium.c | |
parent | 6f6bdcb47fecf7bb672fe621676354b4af3cb06b (diff) |
deflate_medium: fix handling of overlapping matches
Fixes #361
Diffstat (limited to 'deflate_medium.c')
-rw-r--r-- | deflate_medium.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/deflate_medium.c b/deflate_medium.c index 330d255..c23936e 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -110,6 +110,8 @@ static void insert_match(deflate_state *s, struct match match) { } else { functable.insert_string(s, match.strstart, match.orgstart - match.strstart + 1); } + } else if (match.orgstart < match.strstart + match.match_length) { + functable.insert_string(s, match.orgstart, match.strstart + match.match_length - match.orgstart); } match.strstart += match.match_length; match.match_length = 0; |