summaryrefslogtreecommitdiff
path: root/vpx
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2014-03-14 18:37:20 -0700
committerJames Zern <jzern@google.com>2014-03-14 18:37:20 -0700
commit6c0565a4cc0ea835a4b92ade5713894fb6c7824a (patch)
tree63d6459c4f4998ec83b7fb12af7883e1fe1965c7 /vpx
parent7c6337ba9e486c8066db83ea2d845c3e8b7697f8 (diff)
downloadlibvpx-6c0565a4cc0ea835a4b92ade5713894fb6c7824a.tar
libvpx-6c0565a4cc0ea835a4b92ade5713894fb6c7824a.tar.gz
libvpx-6c0565a4cc0ea835a4b92ade5713894fb6c7824a.tar.bz2
libvpx-6c0565a4cc0ea835a4b92ade5713894fb6c7824a.zip
svc_encodeframe: quiet -Warray-bounds warnings
si->layers is validated prior to assignment; add an assertion prior to first use as a loop bound Change-Id: I727d4e24be3c352c3e5320d92e89d3f787944812
Diffstat (limited to 'vpx')
-rw-r--r--vpx/src/svc_encodeframe.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vpx/src/svc_encodeframe.c b/vpx/src/svc_encodeframe.c
index 3e22fdf38..4f3f7ec87 100644
--- a/vpx/src/svc_encodeframe.c
+++ b/vpx/src/svc_encodeframe.c
@@ -13,6 +13,7 @@
* VP9 SVC encoding support via libvpx
*/
+#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
@@ -550,6 +551,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
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) {