From bde6f6eadc24b372c12da2894f2ee0b86b5ff6a3 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 5 Dec 2012 23:16:21 +0100 Subject: [PATCH] vc1dec: prevent v_edge_pos from becoming negative. Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/vc1dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 690cb39a3d..d406b63978 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -981,7 +981,8 @@ static void vc1_mc_4mv_chroma4(VC1Context *v) uvmy_field[i] = (uvmy_field[i] & 3) << 1; if (fieldmv && !(uvsrc_y & 1)) - v_edge_pos--; + v_edge_pos = (s->v_edge_pos >> 1) - 1; + if (fieldmv && (uvsrc_y & 1) && uvsrc_y < 2) uvsrc_y--; if ((v->mv_mode == MV_PMODE_INTENSITY_COMP)