[misc] fix 32-bit arithmetic overflow operation warnings

* Also disable C28251 annotation warning
This commit is contained in:
Pete Batard 2020-02-12 17:23:23 +00:00
parent 67d324f82b
commit 65523bbdf9
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
21 changed files with 53 additions and 48 deletions

View file

@ -262,7 +262,7 @@ unpack_lzma_stream(transformer_state_t *xstate)
rc = rc_init(xstate->src_fd); /*, RC_BUFFER_SIZE); */
while (global_pos + buffer_pos < header.dst_size) {
while ((uint64_t)global_pos + buffer_pos < header.dst_size) {
int pos_state = (buffer_pos + global_pos) & pos_state_mask;
uintptr_t off1 = LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state;
uint16_t *prob1 = p + off1;