From: Angie Chiang Date: Tue, 20 Nov 2018 23:43:04 +0000 (-0800) Subject: Fix scan_build warnings in variance_test.cc X-Git-Tag: v1.8.0~133^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2a0cce56c1ef5bc1c0a02620533d3be24f54c84;p=libvpx Fix scan_build warnings in variance_test.cc BUG=webm:1575 Change-Id: I62602aa47f07d525ba95fe7b2618bf62ae23fe6f --- diff --git a/test/variance_test.cc b/test/variance_test.cc index fce7a1475..e9fa03c68 100644 --- a/test/variance_test.cc +++ b/test/variance_test.cc @@ -561,15 +561,16 @@ class SubpelVarianceTest if (!use_high_bit_depth()) { src_ = reinterpret_cast(vpx_memalign(16, block_size())); sec_ = reinterpret_cast(vpx_memalign(16, block_size())); - ref_ = new uint8_t[block_size() + width() + height() + 1]; + ref_ = reinterpret_cast( + vpx_malloc(block_size() + width() + height() + 1)); #if CONFIG_VP9_HIGHBITDEPTH } else { src_ = CONVERT_TO_BYTEPTR(reinterpret_cast( vpx_memalign(16, block_size() * sizeof(uint16_t)))); sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast( 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(vpx_malloc( + (block_size() + width() + height() + 1) * sizeof(uint16_t)))); #endif // CONFIG_VP9_HIGHBITDEPTH } ASSERT_TRUE(src_ != NULL); @@ -580,12 +581,12 @@ class SubpelVarianceTest 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 }