Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/silk
diff options
context:
space:
mode:
authorFelicia Lim <flim@google.com>2021-02-23 09:29:14 +0300
committerFelicia Lim <flim@google.com>2021-03-03 08:35:16 +0300
commit7b05f44f4baadf34d8d1073f4ff69f1806d5cdb4 (patch)
treea39ed67321c97dd8a60dcefb347a48cbbf7caa7e /silk
parent16286a25fdd865c66a837a73b65fbaa7b25bf484 (diff)
celt_lpc: avoid overflows when computing lpcs in fixed point
The LPCs are computed in 32-bit, so increase the allowed range from +/-8 to +/-64 to avoid overflows caught during fuzzing. Before downshifting back down to the +/-8 range in the final 16-bit output, perform bandwidth extension to avoid any additional overflow issues.
Diffstat (limited to 'silk')
-rw-r--r--silk/LPC_fit.c3
-rw-r--r--silk/bwexpander_32.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/silk/LPC_fit.c b/silk/LPC_fit.c
index cdea4f3a..c0690a1f 100644
--- a/silk/LPC_fit.c
+++ b/silk/LPC_fit.c
@@ -31,7 +31,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "SigProc_FIX.h"
-/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */
+/* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around.
+ This logic is reused in _celt_lpc(). Any bug fixes should also be applied there. */
void silk_LPC_fit(
opus_int16 *a_QOUT, /* O Output signal */
opus_int32 *a_QIN, /* I/O Input signal */
diff --git a/silk/bwexpander_32.c b/silk/bwexpander_32.c
index d0010f73..0f32b9df 100644
--- a/silk/bwexpander_32.c
+++ b/silk/bwexpander_32.c
@@ -31,7 +31,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "SigProc_FIX.h"
-/* Chirp (bandwidth expand) LP AR filter */
+/* Chirp (bandwidth expand) LP AR filter.
+ This logic is reused in _celt_lpc(). Any bug fixes should also be applied there. */
void silk_bwexpander_32(
opus_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */
const opus_int d, /* I Length of ar */