diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index e49df8b2a04fda4713ca8bb9e2d530c4ed08e5ac..9d98b9a8352419a61a2e29c1b0e1045ff1c51e61 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -125,6 +125,8 @@ int ff_rate_control_init(MpegEncContext *s)
         rcc->last_qscale_for[i]=FF_QP2LAMBDA * 5;
     }
     rcc->buffer_index= s->avctx->rc_initial_buffer_occupancy;
+    if (!rcc->buffer_index)
+        rcc->buffer_index = s->avctx->rc_buffer_size * 3 / 4;
 
     if(s->flags&CODEC_FLAG_PASS2){
         int i;