aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq1enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-30 18:09:37 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-02 17:30:24 +0200
commitc297f7e57a223da9f0d350e30456d60c8c87f902 (patch)
tree8c3f75881ed4541ae04a481eaa00801cfcc58be9 /libavcodec/svq1enc.c
parent36dead4bc28ca8aab13c61661f28c68bdefa5e9d (diff)
downloadffmpeg-c297f7e57a223da9f0d350e30456d60c8c87f902.tar.gz
avcodec/svq1enc: Do not print debug RD value before it has been computed
Avoids floating point division by 0 Fixes: Ticket8191 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/svq1enc.c')
-rw-r--r--libavcodec/svq1enc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 09fa15a3a2..91a208180b 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -486,9 +486,10 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
SVQ1EncContext *const s = avctx->priv_data;
int i;
- av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
- s->rd_total / (double)(avctx->width * avctx->height *
- avctx->frame_number));
+ if (avctx->frame_number)
+ av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
+ s->rd_total / (double)(avctx->width * avctx->height *
+ avctx->frame_number));
s->m.mb_type = NULL;
ff_mpv_common_end(&s->m);