shithub: opus

Download patch

ref: c76c4de1232531b80c4f6bdf7415771c326d5e92
parent: b290bca91aeb047d03841bd1897c1cd0ca6d5344
author: Jean-Marc Valin <[email protected]>
date: Fri Jul 22 10:21:26 EDT 2016

Avoid overflowing on ridiculously large energy

--- a/celt/bands.c
+++ b/celt/bands.c
@@ -224,7 +224,7 @@
 #endif
       j=M*eBands[i];
       band_end = M*eBands[i+1];
-      lg = ADD16(bandLogE[i], SHL16((opus_val16)eMeans[i],6));
+      lg = SATURATE16(ADD32(bandLogE[i], SHL32((opus_val32)eMeans[i],6)));
 #ifndef FIXED_POINT
       g = celt_exp2(lg);
 #else