History

fix shift overflow in L3_ldexp_q2 with big iscf[]

lieff committed 8 years ago

Commit c9136401 parent 95ed4411 file · +4 −1Browse files

Unified · Split

minimp3.h+4−1
@@ -716,7 +716,10 @@ static void L3_decode_scalefactors(const uint8_t *hdr, uint8_t *ist_pos, bs_t *b · 715 unmodified lines
716 716
717 for (i = 0; i < (int)(gr->n_long_sfb + gr->n_short_sfb); i++)717 for (i = 0; i < (int)(gr->n_long_sfb + gr->n_short_sfb); i++)
718 {718 {
719 scf[i] = gain*L3_ldexp_q2(iscf[i] << scf_shift);719 if (((iscf[i] << scf_shift) >> 2) >= 31)
720 scf[i] = gain*L3_ldexp_q2((iscf[i] << scf_shift) - 30*4) * /*L3_ldexp_q2(30*4)*/ 9.313226e-10f;
721 else
722 scf[i] = gain*L3_ldexp_q2(iscf[i] << scf_shift);
720 }723 }
721}724}
722 725

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t