diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index e36cc0dc54..fcb25db0bf 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1880,8 +1880,8 @@ static void vc1_interp_mc(VC1Context *v) } if (v->rangeredfrm || s->h_edge_pos < 22 || v_edge_pos < 22 - || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx & 3) - 16 - s->mspel * 3 - || (unsigned)(src_y - s->mspel) > v_edge_pos - (my & 3) - 16 - s->mspel * 3) { + || (unsigned)(src_x - 1) > s->h_edge_pos - (mx & 3) - 16 - 3 + || (unsigned)(src_y - 1) > v_edge_pos - (my & 3) - 16 - 3) { uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize; srcY -= s->mspel * (1 + s->linesize);