aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Pathmudi <shashank.pathmudi@ittiam.com>2023-10-05 15:14:38 +0530
committersandeshvenkatesh <89826624+sandeshvenkatesh@users.noreply.github.com>2023-10-05 16:01:11 +0530
commit0c86a5d8fabe7ab275ff56caed9e4293e627c525 (patch)
tree5636d44d99b53ac62cc3db680774bc818b75cb05
parentaeaaaf49457b590a699eab5e85ae3a51715ea95c (diff)
downloadlibxaac-0c86a5d8fabe7ab275ff56caed9e4293e627c525.tar.gz
Fix for divide-by-zero in ixheaacd_lsf_weight_2st_flt
These changes handle the divide-by-zero runtime error reported while calculating LSF weights. Bug: ossFuzz:62778 Test: poc in bug
-rw-r--r--decoder/ixheaacd_lpc_dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/decoder/ixheaacd_lpc_dec.c b/decoder/ixheaacd_lpc_dec.c
index c43cef5..6f5a711 100644
--- a/decoder/ixheaacd_lpc_dec.c
+++ b/decoder/ixheaacd_lpc_dec.c
@@ -60,7 +60,7 @@ VOID ixheaacd_lsf_weight_2st_flt(FLOAT32 *lsfq, FLOAT32 *w, WORD32 mode) {
}
for (i = 0; i < ORDER; i++) {
- w[i] = (FLOAT32)(factor_table[mode] / (FREQ_DIV / sqrt(d[i] * d[i + 1])));
+ w[i] = (FLOAT32)((factor_table[mode] * sqrt(d[i] * d[i + 1])) / FREQ_DIV);
}
return;