shithub: opus

Download patch

ref: 693421ea238175e67211ce8a0be8d1db450a9698
parent: ff6532c3be8cc1f7873ee2335869340cc98a525f
author: Jean-Marc Valin <[email protected]>
date: Sun Dec 31 10:29:28 EST 2017

Fixes NaN issues in compute_stereo_width()

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -699,6 +699,12 @@
       xy += SHR32(pxy, 10);
       yy += SHR32(pyy, 10);
    }
+#ifndef FIXED_POINT
+   if (!(xx < 1e9f) || celt_isnan(xx) || !(yy < 1e9f) || celt_isnan(yy))
+   {
+      xy = xx = yy = 0;
+   }
+#endif
    mem->XX += MULT16_32_Q15(short_alpha, xx-mem->XX);
    mem->XY += MULT16_32_Q15(short_alpha, xy-mem->XY);
    mem->YY += MULT16_32_Q15(short_alpha, yy-mem->YY);