From 388add965f31263275b3c67e7b206a2ed3b18945 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 18 Mar 2015 14:33:43 -0700 Subject: [PATCH] vp9_fdct8x8_quant_ssse3: quiet a static analysis warning add an assert to validate 'in' array size Change-Id: Ie5a24275c066d9dd59714f6104510abbd4850dc5 --- vp9/encoder/x86/vp9_dct_ssse3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vp9/encoder/x86/vp9_dct_ssse3.c b/vp9/encoder/x86/vp9_dct_ssse3.c index a1a2bda80..bdc75e993 100644 --- a/vp9/encoder/x86/vp9_dct_ssse3.c +++ b/vp9/encoder/x86/vp9_dct_ssse3.c @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #if defined(_MSC_VER) && _MSC_VER <= 1500 // Need to include math.h before calling tmmintrin.h/intrin.h // in certain versions of MSVS. @@ -374,6 +375,7 @@ void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, __m128i qcoeff0, qcoeff1; __m128i qtmp0, qtmp1; + assert(index < (int)(sizeof(in) / sizeof(in[0])) - 1); coeff0 = *in[index]; coeff1 = *in[index + 1]; -- 2.40.0