aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-31 15:27:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:21 +0200
commita44e327a89e8dab14a628b818c20df810eb5796a (patch)
tree524d4c0812e9b8c3e923d64c0d83bc8db7849a94
parent78ece38bc034840a2ccdc4730722df3e6407cb80 (diff)
downloadffmpeg-a44e327a89e8dab14a628b818c20df810eb5796a.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.h3
1 files changed, 2 insertions, 1 deletions
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);
}