summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2022-07-19 16:32:30 -0700
committerJames Zern <jzern@google.com>2022-07-20 09:59:38 -0700
commita36d42f8bd5942de9b2ddf7855f6fac3369d5a7a (patch)
treed1f76b219cc0d625edc7ddf2587d93bb3b085123
parentcc8610e18917c5ef654684a2ae7c3a5dee26640e (diff)
downloadlibvpx-a36d42f8bd5942de9b2ddf7855f6fac3369d5a7a.tar
libvpx-a36d42f8bd5942de9b2ddf7855f6fac3369d5a7a.tar.gz
libvpx-a36d42f8bd5942de9b2ddf7855f6fac3369d5a7a.tar.bz2
libvpx-a36d42f8bd5942de9b2ddf7855f6fac3369d5a7a.zip
pp_filter_test: quiet static analysis warning
in CheckLowFilterOutput(); use std::unique_ptr to avoid spurious memory leak warning: test/pp_filter_test.cc|466 col 3| warning: Potential leak of memory pointed to by 'expected_output' [cplusplus.NewDeleteLeaks] ASSERT_NE(expected_output, nullptr); Bug: b/229626362 Change-Id: Ie9e06c9b9442ffa134e514d2aee70841d19c8ecb
-rw-r--r--test/pp_filter_test.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/pp_filter_test.cc b/test/pp_filter_test.cc
index 775f7f36a..27d5ffa90 100644
--- a/test/pp_filter_test.cc
+++ b/test/pp_filter_test.cc
@@ -7,7 +7,11 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+
#include <limits.h>
+
+#include <memory>
+
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
@@ -458,14 +462,13 @@ TEST_P(VpxMbPostProcDownTest, CheckLowFilterOutput) {
SetRows(src_c_.TopLeftPixel(), rows_, cols_, src_c_.stride());
- unsigned char *expected_output = new unsigned char[rows_ * cols_];
+ std::unique_ptr<unsigned char[]> expected_output(
+ new unsigned char[rows_ * cols_]);
ASSERT_NE(expected_output, nullptr);
- SetRows(expected_output, rows_, cols_, cols_);
+ SetRows(expected_output.get(), rows_, cols_, cols_);
RunFilterLevel(src_c_.TopLeftPixel(), rows_, cols_, src_c_.stride(), q2mbl(0),
- expected_output);
-
- delete[] expected_output;
+ expected_output.get());
}
TEST_P(VpxMbPostProcDownTest, CheckCvsAssembly) {