]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo.c
Second hunk from secrity fix from google.
[ffmpeg] / libavcodec / mpegvideo.c
index f4e80bafe1159337265896480d37e829adab6b6a..65221f34f8e06d1c002e90c3e63ae484128e11bc 100644 (file)
@@ -498,7 +498,7 @@ av_cold int MPV_common_init(MpegEncContext *s)
 
     if(s->codec_id == CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
         s->mb_height = (s->height + 31) / 32 * 2;
-    else
+    else if (s->codec_id != CODEC_ID_H264)
         s->mb_height = (s->height + 15) / 16;
 
     if(s->avctx->pix_fmt == PIX_FMT_NONE){
@@ -964,13 +964,11 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
 
         s->current_picture_ptr= pic;
         //FIXME use only the vars from current_pic
+        s->current_picture_ptr->top_field_first= s->top_field_first;
         if(s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO) {
-            if(s->picture_structure == PICT_FRAME)
-                s->current_picture_ptr->top_field_first= s->top_field_first;
-            else
+            if(s->picture_structure != PICT_FRAME)
                 s->current_picture_ptr->top_field_first= (s->picture_structure == PICT_TOP_FIELD) == s->first_field;
-        } else
-            s->current_picture_ptr->top_field_first= s->top_field_first;
+        }
         s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->progressive_sequence;
     }
 
@@ -1262,7 +1260,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
                         av_log(s->avctx, AV_LOG_DEBUG, "?");
 
 
-                    if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264)
+                    if(IS_INTERLACED(mb_type))
                         av_log(s->avctx, AV_LOG_DEBUG, "=");
                     else
                         av_log(s->avctx, AV_LOG_DEBUG, " ");