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
diff --git a/decoder/ixheaacd_tcx_fwd_mdct.c b/decoder/ixheaacd_tcx_fwd_mdct.c index 267af0d..3fd55e8 100644 --- a/decoder/ixheaacd_tcx_fwd_mdct.c +++ b/decoder/ixheaacd_tcx_fwd_mdct.c
@@ -165,7 +165,7 @@ 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;