summaryrefslogtreecommitdiff
path: root/vpx_dsp
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2022-07-18 18:56:03 -0700
committerJames Zern <jzern@google.com>2022-07-18 19:11:28 -0700
commita5ead0427c21ef15b12f9b582e860b77f714c622 (patch)
treee10fa13a0baf3fbfe0c91bcd3d91dedfd2d043cc /vpx_dsp
parent68d9e7aa2f281a4be6b8f3efb24b67b2bfd1f67d (diff)
downloadlibvpx-a5ead0427c21ef15b12f9b582e860b77f714c622.tar
libvpx-a5ead0427c21ef15b12f9b582e860b77f714c622.tar.gz
libvpx-a5ead0427c21ef15b12f9b582e860b77f714c622.tar.bz2
libvpx-a5ead0427c21ef15b12f9b582e860b77f714c622.zip
vpx_int_pro_row_c: add an assert for height
this quiets a static analysis warning with clang 11: vpx_dsp/avg.c:353:15: warning: Assigned value is garbage or undefined [core.uninitialized.Assign] hbuf[idx] /= norm_factor; ^ ~~~~~~~~~~~ the same fix was applied in libaom: 1ad0889bc aom_int_pro_row_c: add an assert for height Bug: b/229626362 Change-Id: Ic8a249f866b33b02ec9f378581e51ac104d97169
Diffstat (limited to 'vpx_dsp')
-rw-r--r--vpx_dsp/avg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vpx_dsp/avg.c b/vpx_dsp/avg.c
index 1c45e8a73..954015407 100644
--- a/vpx_dsp/avg.c
+++ b/vpx_dsp/avg.c
@@ -7,6 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+
+#include <assert.h>
#include <stdlib.h>
#include "./vpx_dsp_rtcd.h"
@@ -344,6 +346,7 @@ void vpx_int_pro_row_c(int16_t hbuf[16], const uint8_t *ref,
const int ref_stride, const int height) {
int idx;
const int norm_factor = height >> 1;
+ assert(height >= 2);
for (idx = 0; idx < 16; ++idx) {
int i;
hbuf[idx] = 0;