shithub: opus

Download patch

ref: 030074f9ed7ba84179d967cb98a65263375d55d5
parent: c79a9bd1dd2898cd57bb793e037d58c937555c2c
author: Jean-Marc Valin <jeanmarcv@google.com>
date: Fri Feb 28 09:59:26 EST 2025

Fix overflow in fixed-point constant

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1319,7 +1319,7 @@
       fail = tone_lpc(x, N+overlap, delay, lpc);
    }
    /* Check that our filter has complex roots. */
-   if (!fail && MULT32_32_Q31(lpc[0],lpc[0]) + MULT32_32_Q31(QCONST32(4.f, 29), lpc[1]) < 0) {
+   if (!fail && MULT32_32_Q31(lpc[0],lpc[0]) + MULT32_32_Q31(QCONST32(3.999999, 29), lpc[1]) < 0) {
       /* Squared radius of the poles. */
       *toneishness = -lpc[1];
 #ifdef FIXED_POINT
--