mirror of
https://github.com/shadps4-emu/ext-zlib-ng.git
synced 2024-10-07 00:13:58 +00:00
Fix out-of-bound access of zng_length_codes.
This commit is contained in:
parent
bf985ade30
commit
f346148df0
@ -99,6 +99,8 @@ Z_INTERNAL block_state deflate_quick(deflate_state *s, int flush) {
|
||||
if (match_len >= WANT_MIN_MATCH) {
|
||||
if (UNLIKELY(match_len > s->lookahead))
|
||||
match_len = s->lookahead;
|
||||
if (UNLIKELY(match_len > STD_MAX_MATCH))
|
||||
match_len = STD_MAX_MATCH;
|
||||
|
||||
check_match(s, s->strstart, hash_head, match_len);
|
||||
|
||||
|
@ -47,6 +47,7 @@ Z_INTERNAL block_state deflate_rle(deflate_state *s, int flush) {
|
||||
scan < strend);
|
||||
match_len = STD_MAX_MATCH - (unsigned int)(strend - scan);
|
||||
match_len = MIN(match_len, s->lookahead);
|
||||
match_len = MIN(match_len, STD_MAX_MATCH);
|
||||
}
|
||||
Assert(scan <= s->window + s->window_size - 1, "wild scan");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user