From c67411593960f1a133657f0da930c8681a6a62b4 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 17 Mar 2002 18:08:11 +0000
Subject: [PATCH] 10l

Originally committed as revision 336 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/mpegvideo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 15af25d7b7f..9b236719529 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1675,6 +1675,7 @@ static int rate_estimate_qscale(MpegEncContext *s)
 
     diff= s->total_bits - wanted_bits;
     br_compensation= (s->bit_rate_tolerance - diff)/s->bit_rate_tolerance;
+    if(br_compensation<=0.0) br_compensation=0.001;
     q/=br_compensation;
 
     qscale= (int)(q + 0.5);
-- 
GitLab