diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-05-31 15:27:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:34:53 +0200 |
commit | 8af3700cf1db5d4da0e1973a80acbe72944994a6 (patch) | |
tree | 3b6d3e7278e45d210c38352fba9042c895b05542 | |
parent | 6977ac932143a16113f5ced44ad2c83cabac9203 (diff) | |
download | ffmpeg-8af3700cf1db5d4da0e1973a80acbe72944994a6.tar.gz |
avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()
Fixes: floating point division by 0
Fixes: Ticket8213
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70874e024a6eae0f95bd8dd4b9b4367ffd937f41)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/lpc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h index 13c59dad54..224276ffb9 100644 --- a/libavcodec/lpc.h +++ b/libavcodec/lpc.h @@ -183,7 +183,8 @@ static inline int AAC_RENAME(compute_lpc_coefs)(const LPC_TYPE *autoc, int max_o for(j=0; j<i; j++) r -= lpc_last[j] * autoc[i-j-1]; - r /= err; + if (err) + r /= err; err *= FIXR(1.0) - (r * r); } |