diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 70cc5f8c14fa6c75d43ea1b78407faf8d9bc32e3..743e992dacfed88f561e1f3885366e88563c7589 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -5369,7 +5369,8 @@ static void encode_picture(MpegEncContext *s, int picture_number)
     }
 
     if (!s->fixed_qscale)
-        s->current_picture.quality = ff_rate_estimate_qscale(s); //FIXME pic_ptr
+        s->current_picture_ptr->quality=
+        s->current_picture.quality = ff_rate_estimate_qscale(s);
 
     if(s->adaptive_quant){
         switch(s->codec_id){