ref_offset must be added after checking references validity.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Feb 2010 01:13:56 +0000 (01:13 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Feb 2010 01:13:56 +0000 (01:13 +0000)
Originally committed as revision 21661 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264_direct.c

index f347e25..9b6ca8a 100644 (file)
@@ -434,9 +434,9 @@ single_col:
                     continue;
                 }
 
-                ref0 = l1ref0[x8 + y8*b8_stride] + ref_offset;
+                ref0 = l1ref0[x8 + y8*b8_stride];
                 if(ref0 >= 0)
-                    ref0 = map_col_to_list0[0][ref0];
+                    ref0 = map_col_to_list0[0][ref0 + ref_offset];
                 else{
                     ref0 = map_col_to_list0[1][l1ref1[x8 + y8*b8_stride] + ref_offset];
                     l1mv= l1mv1;