From 637590cdc854b56014e03069608308fcf1cdd227 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Wed, 16 Nov 2016 15:15:46 -0800 Subject: [PATCH] Fix warnings from static analaysis tools Change-Id: Iad227b07b6c3f5beebef971cabec787b01e6f51f --- av1/common/av1_txfm.h | 1 + av1/encoder/encoder.c | 1 + test/av1_convolve_test.cc | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/av1/common/av1_txfm.h b/av1/common/av1_txfm.h index c2f1b1a52..84c416f33 100644 --- a/av1/common/av1_txfm.h +++ b/av1/common/av1_txfm.h @@ -67,6 +67,7 @@ static const int32_t cospi_arr[7][64] = { }; static INLINE int32_t round_shift(int32_t value, int bit) { + assert(bit >= 1); return (value + (1 << (bit - 1))) >> bit; } diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index eba95913e..181d88f67 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -2821,6 +2821,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, const int taps = interp_filter_params.taps; int x, y, i; + assert(planes <= 3); for (y = 0; y < dst_h; y += 16) { for (x = 0; x < dst_w; x += 16) { for (i = 0; i < planes; ++i) { diff --git a/test/av1_convolve_test.cc b/test/av1_convolve_test.cc index 0324b8e9c..fda5b8035 100644 --- a/test/av1_convolve_test.cc +++ b/test/av1_convolve_test.cc @@ -103,9 +103,10 @@ TEST(AV1ConvolveTest, av1_convolve) { int subpel_x_q4; int subpel_y_q4; + ASSERT_LE(filter_size, 12); setup_convolve(); - for (int i = 0; i < filter_size * filter_size; i++) { + for (int i = 0; i < static_cast(sizeof(src) / sizeof(src[0])); i++) { src[i] = rnd.Rand16() % (1 << 8); }