aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-14 23:03:50 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:48 +0100
commit8381e82f9cc08caac3f8f62ee4667cfcbce9c858 (patch)
tree38896630f73185f70f39e81c9275f445eb93769c
parentaa9aba0fe138da4126c04ed3f5b406c6e0024b06 (diff)
downloadffmpeg-8381e82f9cc08caac3f8f62ee4667cfcbce9c858.tar.gz
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 55279d699fa64d8eb1185d8db04ab4ed92e8dea2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snowenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index b886be75dc..75051dc87e 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -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));