[FFmpeg-cvslog] avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()
Michael Niedermayer
git at videolan.org
Wed Sep 8 22:43:01 EEST 2021
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon May 31 15:27:18 2021 +0200| [1196932f1cee6b6a3776b62e6bf1d5dac82236c7] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 70874e024a6eae0f95bd8dd4b9b4367ffd937f41)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1196932f1cee6b6a3776b62e6bf1d5dac82236c7
---
libavcodec/lpc.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
index 52170fd623..e1b41bfd9b 100644
--- a/libavcodec/lpc.h
+++ b/libavcodec/lpc.h
@@ -186,7 +186,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);
}
More information about the ffmpeg-cvslog
mailing list