diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-10 13:19:46 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-10 13:19:46 +0000 |
commit | 46aad4594b119308b3b896d275a8541e52a86491 (patch) | |
tree | c57c88c77fbc80b596ee8b71adf1bdb8a6ea1616 | |
parent | 31578f16ab5e7ebc063fc1e57772e2ffc456ee76 (diff) | |
parent | 88f50571216045a068bf28447b069364dada782c (diff) | |
download | zlib-46aad4594b119308b3b896d275a8541e52a86491.tar.gz |
Snap for 9390999 from 88f50571216045a068bf28447b069364dada782c to mainline-media-swcodec-releaseaml_swc_331911000aml_swc_331712000aml_swc_331612000aml_swc_331511000android13-mainline-media-swcodec-release
Change-Id: I1a20cd9a8458acc96be1ac1e7ee0f880e794be83
-rw-r--r-- | contrib/optimizations/inflate.c | 5 | ||||
-rw-r--r-- | inflate.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/contrib/optimizations/inflate.c b/contrib/optimizations/inflate.c index 81d558b..93776ac 100644 --- a/contrib/optimizations/inflate.c +++ b/contrib/optimizations/inflate.c @@ -771,8 +771,9 @@ int flush; if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); @@ -760,8 +760,9 @@ int flush; if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); |