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>
(cherry picked from commit c297f7e57a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-05-30 18:09:37 +02:00
parent 4e779e4ace
commit e01ffd6f3f
1 changed files with 4 additions and 3 deletions

View File

@ -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);