From: James Zern Date: Wed, 18 Mar 2015 21:33:04 +0000 (-0700) Subject: vp9_fdct8x8_quant_sse2: quiet a static analysis warning X-Git-Tag: v1.4.0~17^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=198b039e2a5c7cb1d82e061a166ebf9258b21822;p=libvpx vp9_fdct8x8_quant_sse2: quiet a static analysis warning add an assert to validate 'in' array size Change-Id: Ib72946a86f34e1ce8a69954e8e3e4fe1a0f18a91 --- diff --git a/vp9/encoder/x86/vp9_dct_sse2.c b/vp9/encoder/x86/vp9_dct_sse2.c index 279074ce3..564b7955e 100644 --- a/vp9/encoder/x86/vp9_dct_sse2.c +++ b/vp9/encoder/x86/vp9_dct_sse2.c @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include #include // SSE2 #include "vp9/common/vp9_idct.h" // for cospi constants #include "vp9/encoder/vp9_dct.h" @@ -610,6 +611,7 @@ void vp9_fdct8x8_quant_sse2(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];