Browse Source

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>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
7b1e0beb2d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/mpegvideo_motion.c

+ 1
- 1
libavcodec/mpegvideo_motion.c View File

@@ -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,


Loading…
Cancel
Save