aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lpc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-28 20:31:19 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-05-29 20:14:24 +0200
commit38d18fb57863bb9c54e68ae44aa780c5c282a184 (patch)
tree0905625e67e965ce090e6c15fc002233d3d0c8bf /libavcodec/lpc.c
parent223b5e8ac9f6461bb13ed365419ec485c5b2b002 (diff)
downloadffmpeg-38d18fb57863bb9c54e68ae44aa780c5c282a184.tar.gz
avcodec/lpc: Avoid floating point division by 0
Fixes: Ticket7996 Fixes: CVE-2020-20445 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r--libavcodec/lpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 1d1d04fd80..3ed61563ee 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -189,7 +189,7 @@ double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len,
compute_ref_coefs(autoc, order, ref, error);
for (i = 0; i < order; i++)
avg_err = (avg_err + error[i])/2.0f;
- return signal/avg_err;
+ return avg_err ? signal/avg_err : NAN;
}
/**