summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Räncker <theonetruecamper@gmx.de>2018-09-23 13:07:44 +0200
committerMatthias Räncker <theonetruecamper@gmx.de>2018-09-23 17:30:06 +0200
commit8b9edfc5287595e19f2f3c1acd7e9c60e5c15ca8 (patch)
tree834f7ddc47c3fab1a738ff9ca37331de85d2ef66
parent3448987ab20aa05716ffc4aedf6d02e23f75920b (diff)
downloadlibvpx-8b9edfc5287595e19f2f3c1acd7e9c60e5c15ca8.tar
libvpx-8b9edfc5287595e19f2f3c1acd7e9c60e5c15ca8.tar.gz
libvpx-8b9edfc5287595e19f2f3c1acd7e9c60e5c15ca8.tar.bz2
libvpx-8b9edfc5287595e19f2f3c1acd7e9c60e5c15ca8.zip
fix integer overflow caused by uninitialized memory
Signed-off-by: Matthias Räncker <theonetruecamper@gmx.de> Change-Id: I55ec2a803eff89b07376459e334d4e949bfcb2cc
-rw-r--r--test/avg_test.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/avg_test.cc b/test/avg_test.cc
index e8cac0797..5455f05ed 100644
--- a/test/avg_test.cc
+++ b/test/avg_test.cc
@@ -263,6 +263,8 @@ class SatdTest : public ::testing::Test,
EXPECT_EQ(expected, total);
}
+ tran_low_t *GetCoeff() const { return src_; }
+
int satd_size_;
private:
@@ -317,6 +319,10 @@ class BlockErrorTestFP
EXPECT_EQ(expected, total);
}
+ tran_low_t *GetCoeff() const { return coeff_; }
+
+ tran_low_t *GetDQCoeff() const { return dqcoeff_; }
+
int txfm_size_;
private:
@@ -428,8 +434,9 @@ TEST_P(SatdTest, Random) {
TEST_P(SatdTest, DISABLED_Speed) {
const int kCountSpeedTestBlock = 20000;
vpx_usec_timer timer;
- DECLARE_ALIGNED(16, tran_low_t, coeff[1024]);
const int blocksize = GET_PARAM(0);
+ FillRandom();
+ tran_low_t *coeff = GetCoeff();
vpx_usec_timer_start(&timer);
for (int i = 0; i < kCountSpeedTestBlock; ++i) {
@@ -472,9 +479,10 @@ TEST_P(BlockErrorTestFP, Random) {
TEST_P(BlockErrorTestFP, DISABLED_Speed) {
const int kCountSpeedTestBlock = 20000;
vpx_usec_timer timer;
- DECLARE_ALIGNED(16, tran_low_t, coeff[1024]);
- DECLARE_ALIGNED(16, tran_low_t, dqcoeff[1024]);
const int blocksize = GET_PARAM(0);
+ FillRandom();
+ tran_low_t *coeff = GetCoeff();
+ tran_low_t *dqcoeff = GetDQCoeff();
vpx_usec_timer_start(&timer);
for (int i = 0; i < kCountSpeedTestBlock; ++i) {