[FFmpeg-cvslog] avcodec/mpegvideo_enc: dont use direct mode for unaligned input

Michael Niedermayer git at videolan.org
Mon Mar 17 16:08:42 CET 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 15 14:50:37 2014 +0100| [7b7d8b879428bd4bcaf1a5e31b731fc86a8b43a3] | committer: Carl Eugen Hoyos

avcodec/mpegvideo_enc: dont use direct mode for unaligned input

Fixes Ticket3456

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 06a3185e38614ff22e4586675b85228f07819452)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b7d8b879428bd4bcaf1a5e31b731fc86a8b43a3
---

 libavcodec/mpegvideo_enc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index bb49822..64d73dd 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1039,6 +1039,10 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
             direct = 0;
         if ((s->width & 15) || (s->height & 15))
             direct = 0;
+        if (((intptr_t)(pic_arg->data[0])) & (STRIDE_ALIGN-1))
+            direct = 0;
+        if (s->linesize & (STRIDE_ALIGN-1))
+            direct = 0;
 
         av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
                 pic_arg->linesize[1], s->linesize, s->uvlinesize);



More information about the ffmpeg-cvslog mailing list