]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 14 Oct 2019 21:03:50 +0000 (23:03 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 9 Nov 2019 12:46:20 +0000 (13:46 +0100)
Fixes: Ticket7990
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/snowenc.c

index 4166ce4e1d78a9687f8139ea6053fc0422fba814..3f2a75a6707f91dc0686a7461417cfa9ecbad37d 100644 (file)
@@ -81,6 +81,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     s->m.bit_rate= avctx->bit_rate;
     s->m.lmin    = avctx->mb_lmin;
     s->m.lmax    = avctx->mb_lmax;
+    s->m.mb_num  = (avctx->width * avctx->height + 255) / 256; // For ratecontrol
 
     s->m.me.temp      =
     s->m.me.scratchpad= av_mallocz_array((avctx->width+64), 2*16*2*sizeof(uint8_t));