]> granicus.if.org Git - libvpx/commitdiff
Fix a potential invalid memory access in non-RD coding flow
authorJingning Han <jingning@google.com>
Fri, 11 Jul 2014 20:37:28 +0000 (13:37 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Fri, 11 Jul 2014 22:50:43 +0000 (15:50 -0700)
This commit fixes a potential out-of-boundary memory access due to
the use of reuse_inter_pred_sby in the non-RD coding flow. It
resolves the corresponding asan error.

Change-Id: Iff605f5921230966990013541cd855d698810922

test/cpu_speed_test.cc
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_speed_features.c

index 9dca6014d62fc4d85b6ea01cb6db87f083f6d0bc..4477bf02d6b277bdfa97a72d54db94fe9426cba9 100644 (file)
@@ -139,5 +139,5 @@ VP9_INSTANTIATE_TEST_CASE(
     CpuSpeedTest,
     ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
                       ::libvpx_test::kRealTime),
-    ::testing::Range(0, 8));
+    ::testing::Range(0, 9));
 }  // namespace
index 31e6fcb8d33c99764908cadb89196d875294fb9e..e9fa3ded40b72cd9e9de8870cc495f29bcfc8010 100644 (file)
@@ -685,7 +685,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
 
     int rate2 = 0;
     int64_t dist2 = 0;
-    const int dst_stride = pd->dst.stride;
+    const int dst_stride = cpi->sf.reuse_inter_pred_sby ? bw : pd->dst.stride;
     const int src_stride = p->src.stride;
     int block_idx = 0;
 
index f271182627f932ffe3c73bc02df5ed94e5e85cf7..450cab4f2a17fa581a9b369e621779872aacea0c 100644 (file)
@@ -296,6 +296,7 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
   }
   if (speed >= 8) {
     int i;
+    sf->max_intra_bsize = BLOCK_32X32;
     for (i = 0; i < BLOCK_SIZES; ++i)
       sf->inter_mode_mask[i] = INTER_NEAREST;
   }