[FFmpeg-cvslog] vc1dec: prevent v_edge_pos from becoming negative.

Michael Niedermayer git at videolan.org
Thu Dec 6 03:17:36 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec  5 23:16:21 2012 +0100| [bde6f6eadc24b372c12da2894f2ee0b86b5ff6a3] | committer: Michael Niedermayer

vc1dec: prevent v_edge_pos from becoming negative.

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/vc1dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 690cb39..d406b63 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)



More information about the ffmpeg-cvslog mailing list