shithub: opus

Download patch

ref: e5ad26169502c1f0b067916e782c2b3fdea6fba9
parent: 70e3c348228a28ea7f62def5ecbce71b975a517b
author: Jean-Marc Valin <[email protected]>
date: Wed Sep 14 07:38:15 EDT 2016

Prevents ridiculously large gains from causing inf/NaNs in float decoder

--- a/celt/bands.c
+++ b/celt/bands.c
@@ -226,7 +226,7 @@
       band_end = M*eBands[i+1];
       lg = SATURATE16(ADD32(bandLogE[i], SHL32((opus_val32)eMeans[i],6)));
 #ifndef FIXED_POINT
-      g = celt_exp2(lg);
+      g = celt_exp2(MIN32(32.f, lg));
 #else
       /* Handle the integer part of the log energy */
       shift = 16-(lg>>DB_SHIFT);