Fix use of uninitialized memory in CONFIG_ABOVESPREFMV
authorJohn Koleszar <jkoleszar@google.com>
Thu, 28 Feb 2013 21:45:47 +0000 (13:45 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 28 Feb 2013 21:48:58 +0000 (13:48 -0800)
The ABOVESPREFMV experiment uses four pixels to the left of the
current block, which don't exist for the left-most column.

Change-Id: I4cf0b42ae8f54c0b3e7b1ed8755704b74fafc39c

vp9/common/vp9_findnearmv.c

index f713212..77b7939 100644 (file)
@@ -190,7 +190,11 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
       col_offset = this_mv.as_mv.col >> 3;
       offset = ref_y_stride * row_offset + col_offset;
       score = 0;
+#if !CONFIG_ABOVESPREFMV
       if (xd->up_available) {
+#else
+      if (xd->up_available && xd->left_available) {
+#endif
         vp9_sub_pixel_variance16x2(above_ref + offset, ref_y_stride,
                                    SP(this_mv.as_mv.col),
                                    SP(this_mv.as_mv.row),