Browse Source

avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0

Fixes: Ticket7990

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 55279d699f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0.5
Michael Niedermayer 6 years ago
parent
commit
8381e82f9c
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/snowenc.c

+ 1
- 0
libavcodec/snowenc.c View 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));


Loading…
Cancel
Save