Fix for Divide-by-zero in ixheaacd_lpc_to_td

This changes handle the Divide-by-zero runtime error
reported while calculating the gain because
imaginary and real data were zero.

Bug: ossFuzz:61788
Test: poc in bug
This commit is contained in:
Yash Patil 2023-09-15 19:10:00 +05:30 • committed by sandeshvenkatesh
parent c07f14410b
commit 596d791059

View file

@ -165,7 +165,7 @@ VOID ixheaacd_lpc_to_td(FLOAT32 *coeff, WORD32 order, FLOAT32 *gains, WORD32 lg)
for (i = 0; i < size_n / 2; i++) {
gains[i] =
(FLOAT32)(1.0f / sqrt(data_r[i] * data_r[i] + data_i[i] * data_i[i]));
(FLOAT32)(1.0f / (sqrt(data_r[i] * data_r[i] + data_i[i] * data_i[i]) + FLT_EPSILON));
}
return;