ref: 703272ce0ae2820e3a666f70050e12ffed6dbf55
parent: 263ac5294368475b8aebe1a1e8b616cb69499ac7
author: lieff <lieff@users.noreply.github.com>
date: Wed Jan 31 07:45:05 EST 2018
fix ubsan "signed integer overflow" warning
--- a/minimp3.h
+++ b/minimp3.h
@@ -770,7 +770,7 @@
int ireg = 0, big_val_cnt = gr_info->big_values;
const uint8_t *sfb = gr_info->sfbtab;
const uint8_t *bs_next_ptr = bs->buf + bs->pos/8;
- uint32_t bs_cache = (((bs_next_ptr[0]*256 + bs_next_ptr[1])*256 + bs_next_ptr[2])*256 + bs_next_ptr[3]) << (bs->pos & 7);
+ uint32_t bs_cache = (((bs_next_ptr[0]*256u + bs_next_ptr[1])*256u + bs_next_ptr[2])*256u + bs_next_ptr[3]) << (bs->pos & 7);
int pairs_to_decode, np, bs_sh = (bs->pos & 7) - 8;
bs_next_ptr += 4;