diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-12 16:11:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-12 18:21:20 +0100 |
commit | 7b1e0beb2da31a0a8847bc9c68a87a120b71fa8a (patch) | |
tree | 4bb07819af9eae5fd0547f737f01cbd499be510d | |
parent | 8146ee7ae9091da6db3b6d2dc6c4c87ffd7460ab (diff) | |
download | ffmpeg-7b1e0beb2da31a0a8847bc9c68a87a120b71fa8a.tar.gz |
avcodec/mpegvideo_motion: Handle edge emulation even without unrestricted_mv
Fixes out of array reads
Fixes part of: MSVR 440 (the other issues seem to have been fixed already)
Found-by: Jeremy Brown (jerbrown) of ReSP
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 862ca25a3f..48bfe5d52a 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -209,7 +209,7 @@ static inline int hpel_motion(MpegEncContext *s, dxy |= (motion_y & 1) << 1; src += src_y * s->linesize + src_x; - if (s->unrestricted_mv && (s->flags & CODEC_FLAG_EMU_EDGE)) { + if (s->flags & CODEC_FLAG_EMU_EDGE) { if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) || (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) { s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->linesize, src, |