Unverified Commit e5ad2616 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

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

parent 70e3c348
......@@ -226,7 +226,7 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
band_end = M*eBands[i+1];
lg = SATURATE16(ADD32(bandLogE[i], SHL32((opus_val32)eMeans[i],6)));
g = celt_exp2(lg);
g = celt_exp2(MIN32(32.f, lg));
/* Handle the integer part of the log energy */
shift = 16-(lg>>DB_SHIFT);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment