si->layers is validated prior to assignment; add an assertion prior to
first use as a loop bound
Change-Id: I727d4e24be3c352c3e5320d92e89d3f787944812
* VP9 SVC encoding support via libvpx
*/
+#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
float total = 0;
float alloc_ratio[VPX_SS_MAX_LAYERS] = {0};
+ assert(si->layers <= VPX_SS_MAX_LAYERS);
for (i = 0; i < si->layers; ++i) {
int pos = i + VPX_SS_MAX_LAYERS - svc_ctx->spatial_layers;
if (pos < VPX_SS_MAX_LAYERS && si->scaling_factor_den[pos] > 0) {