shithub: libvpx

Download patch

ref: a2a0cce56c1ef5bc1c0a02620533d3be24f54c84
parent: 59e4e673033d86dc815fa4f44058d8e903d340d4
author: Angie Chiang <[email protected]>
date: Tue Nov 20 10:43:04 EST 2018

Fix scan_build warnings in variance_test.cc

BUG=webm:1575

Change-Id: I62602aa47f07d525ba95fe7b2618bf62ae23fe6f

--- a/test/variance_test.cc
+++ b/test/variance_test.cc
@@ -561,7 +561,8 @@
     if (!use_high_bit_depth()) {
       src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
       sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size()));
-      ref_ = new uint8_t[block_size() + width() + height() + 1];
+      ref_ = reinterpret_cast<uint8_t *>(
+          vpx_malloc(block_size() + width() + height() + 1));
 #if CONFIG_VP9_HIGHBITDEPTH
     } else {
       src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
@@ -568,8 +569,8 @@
           vpx_memalign(16, block_size() * sizeof(uint16_t))));
       sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
           vpx_memalign(16, block_size() * sizeof(uint16_t))));
-      ref_ = CONVERT_TO_BYTEPTR(
-          new uint16_t[block_size() + width() + height() + 1]);
+      ref_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(vpx_malloc(
+          (block_size() + width() + height() + 1) * sizeof(uint16_t))));
 #endif  // CONFIG_VP9_HIGHBITDEPTH
     }
     ASSERT_TRUE(src_ != NULL);
@@ -580,12 +581,12 @@
   virtual void TearDown() {
     if (!use_high_bit_depth()) {
       vpx_free(src_);
-      delete[] ref_;
       vpx_free(sec_);
+      vpx_free(ref_);
 #if CONFIG_VP9_HIGHBITDEPTH
     } else {
       vpx_free(CONVERT_TO_SHORTPTR(src_));
-      delete[] CONVERT_TO_SHORTPTR(ref_);
+      vpx_free(CONVERT_TO_SHORTPTR(ref_));
       vpx_free(CONVERT_TO_SHORTPTR(sec_));
 #endif  // CONFIG_VP9_HIGHBITDEPTH
     }