aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-29 17:49:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:49 +0200
commitbcab3700dfaf765e2df068fc0f7c3679bc1aec42 (patch)
tree2974673988fe954a4394dae2ab63a839fb7b0159
parent0c71bd5ebf113f14e80af856b34d81a4e46dda81 (diff)
downloadffmpeg-bcab3700dfaf765e2df068fc0f7c3679bc1aec42.tar.gz
avcodec/aacenc: Do not divide by lambda_count if it is 0
Avoids Floating point division by 0 Fixes: Ticket8011 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c520b986915a3fdf3a20f6ce0ad5833eccfb7a91) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aacenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 0248077822..94b3e81699 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -854,7 +854,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
{
AACEncContext *s = avctx->priv_data;
- av_log(avctx, AV_LOG_INFO, "Qavg: %.3f\n", s->lambda_sum / s->lambda_count);
+ av_log(avctx, AV_LOG_INFO, "Qavg: %.3f\n", s->lambda_count ? s->lambda_sum / s->lambda_count : NAN);
ff_mdct_end(&s->mdct1024);
ff_mdct_end(&s->mdct128);