ref: aa2801e1128d3d69ed805483e0369ab18ad556b3
parent: 0da45b1cc712fe1b10a0ebd76d9dcd1391f040f8
author: lieff <lieff@users.noreply.github.com>
date: Sun Feb 11 13:43:13 EST 2018
fix ubsan warning found by afl
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@
| Keyj minimp3 | Current |
| ------------ | ------- |
| Fixed point | Floating point |
-| source: 84kb | 69kb |
+| source: 84kb | 70kb |
| binary: 34kb (20kb compressed) | 30kb (20kb) |
| no vector opts | SSE/NEON intrinsics |
| no free format | free format support |
--- a/minimp3.h
+++ b/minimp3.h
@@ -613,7 +613,7 @@
static void L3_read_scalefactors(uint8_t *scf, uint8_t *ist_pos, const uint8_t *scf_size, const uint8_t *scf_count, bs_t *bitbuf, int scfsi)
{
int i, k;
- for (i = 0; i < 4 && scf_count[i]; i++, scfsi <<= 1)
+ for (i = 0; i < 4 && scf_count[i]; i++, scfsi *= 2)
{
int cnt = scf_count[i];
if (scfsi & 8)