shithub: opus

Download patch

ref: 0713a18ebc87bad579b901b3dcd2499d8e5b552b
parent: e9b243b32a7d2e85b0dcfb9704c507bb59f8a3cf
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Fri Mar 1 12:34:52 EST 2024

Fix overflow in CELT Deep PLC

Added proper saturation and rounding

--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -589,7 +589,7 @@
       for (j=0;j<SINC_ORDER+1;j++) {
          sum += buf48k[3*i + j + offset]*sinc_filter[j];
       }
-      buf16k[i] = sum;
+      buf16k[i] = float2int(MIN32(32767.f, MAX32(-32767.f, sum)));
    }
    tmp_read_post = lpcnet->fec_read_pos;
    tmp_fec_skip = lpcnet->fec_skip;
--