shithub: libvpx

Download patch

ref: 35ebc1cddf3542692acf3690302dd2028ce251fb
parent: b6e686b1ea0cb5d609de85836b829557660e7d55
author: Johann <johannkoenig@google.com>
date: Wed Sep 21 09:31:59 EDT 2016

predict_test: align dst buffer to 16

On 32 bit machines 'new' does not always appear to allocate sufficiently
aligned buffers, causing intermittent test failures.

Change-Id: I0db4fc73782012e4eef71dc0fb540e74fdbfcebe

--- a/test/predict_test.cc
+++ b/test/predict_test.cc
@@ -20,6 +20,7 @@
 #include "test/register_state_check.h"
 #include "test/util.h"
 #include "vpx/vpx_integer.h"
+#include "vpx_mem/vpx_mem.h"
 
 namespace {
 
@@ -46,7 +47,8 @@
     // memory to facilitate detecting out of bounds writes.
     dst_stride_ = kBorderSize + width_ + kBorderSize;
     padded_dst_size_ = dst_stride_ * (kBorderSize + height_ + kBorderSize);
-    padded_dst_ = new uint8_t[padded_dst_size_];
+    padded_dst_ =
+        reinterpret_cast<uint8_t *>(vpx_memalign(16, padded_dst_size_));
     ASSERT_TRUE(padded_dst_ != NULL);
     dst_ = padded_dst_ + (kBorderSize * dst_stride_) + kBorderSize;
 
@@ -61,7 +63,7 @@
   virtual void TearDown() {
     delete[] src_;
     src_ = NULL;
-    delete[] padded_dst_;
+    vpx_free(padded_dst_);
     padded_dst_ = NULL;
     dst_ = NULL;
     delete[] dst_c_;