From: Johann Date: Wed, 14 Mar 2018 20:10:08 +0000 (-0700) Subject: vp8 mfqe: zero map[] X-Git-Tag: v1.8.0~797^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f41c0d37f59d3099260b435a87a6f89de404695;p=libvpx 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 --- 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) {