avcodec/mpegvideo_enc: make edge for interlaced mpeg2 encoding smaller
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Jul 2014 17:51:02 +0000 (19:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Jul 2014 17:56:24 +0000 (19:56 +0200)
Fixes segfault
the size can probably be reduced further for the mpeg2 case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegvideo_enc.c

index 4bb79f6..a4786b4 100644 (file)
@@ -1146,7 +1146,8 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
                     int vpad = 16;
 
                     if (   s->codec_id == AV_CODEC_ID_MPEG2VIDEO
-                        && !s->progressive_sequence)
+                        && !s->progressive_sequence
+                        && FFALIGN(s->height, 32) - s->height > 16)
                         vpad = 32;
 
                     if (!s->avctx->rc_buffer_size)