shithub: libvpx

Download patch

ref: 388add965f31263275b3c67e7b206a2ed3b18945
parent: 198b039e2a5c7cb1d82e061a166ebf9258b21822
author: James Zern <jzern@google.com>
date: Wed Mar 18 10:33:43 EDT 2015

vp9_fdct8x8_quant_ssse3: quiet a static analysis warning

add an assert to validate 'in' array size

Change-Id: Ie5a24275c066d9dd59714f6104510abbd4850dc5

--- 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 <assert.h>
 #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 @@
         __m128i qcoeff0, qcoeff1;
         __m128i qtmp0, qtmp1;
 
+        assert(index < (int)(sizeof(in) / sizeof(in[0])) - 1);
         coeff0 = *in[index];
         coeff1 = *in[index + 1];