From 1f41c0d37f59d3099260b435a87a6f89de404695 Mon Sep 17 00:00:00 2001 From: Johann Date: Wed, 14 Mar 2018 13:10:08 -0700 Subject: [PATCH] vp8 mfqe: zero map[] The loop appears to set map[i] with the intention of running the 'j' loop up to that point. However, without zero'ing map[] first the behavior is unpredictable. Fixes a static analysis warning: warning: Branch condition evaluates to a garbage value for (j = 0; j < 4 && map[j]; ++j) { Change-Id: Ifa39353d8aa5cc47b467a7d3d8cdd3b5319fd997 --- vp8/common/mfqe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vp8/common/mfqe.c b/vp8/common/mfqe.c index b6f8146b8..aad908572 100644 --- a/vp8/common/mfqe.c +++ b/vp8/common/mfqe.c @@ -18,6 +18,7 @@ #include "./vp8_rtcd.h" #include "./vpx_dsp_rtcd.h" +#include "vp8/common/common.h" #include "vp8/common/postproc.h" #include "vpx_dsp/variance.h" #include "vpx_mem/vpx_mem.h" @@ -211,6 +212,7 @@ static int qualify_inter_mb(const MODE_INFO *mode_info_context, int *map) { { 0, 1, 4, 5 }, { 2, 3, 6, 7 }, { 8, 9, 12, 13 }, { 10, 11, 14, 15 } }; int i, j; + vp8_zero(*map); for (i = 0; i < 4; ++i) { map[i] = 1; for (j = 0; j < 4 && map[j]; ++j) { -- 2.40.0