shithub: libvpx

Download patch

ref: 1f41c0d37f59d3099260b435a87a6f89de404695
parent: 8276005eba660ee076ccb9712d6f005c38419880
author: Johann <johannkoenig@google.com>
date: Wed Mar 14 09:10:08 EDT 2018

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

--- 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 @@
       { 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) {