aom: Zero initialize an array in cdef search

From fa4304274a644acfbb87c8d67631e664e3f06cad Mon Sep 17 00:00:00 2001
From: Cheng Chen <[EMAIL REDACTED]>
Date: Mon, 22 Jan 2024 16:59:05 -0800
Subject: [PATCH] Zero initialize an array in cdef search

This array was not initialized.

The array is supposed to store the best corresponding cdef filter
strength. And its value is an index of another array.

Without the initialization, this might lead to out of bound access
to the other array.

Change-Id: Id65c448f479865992ada0b09ff6e97b2d2ac3362
(cherry picked from commit 6fcad835fbd1cba379f34ecb96755888d21a98df)
---
 av1/encoder/pickcdef.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/av1/encoder/pickcdef.c b/av1/encoder/pickcdef.c
index 232a2f9edb..ed5fa55f17 100644
--- a/av1/encoder/pickcdef.c
+++ b/av1/encoder/pickcdef.c
@@ -894,7 +894,7 @@ void av1_cdef_search(AV1_COMP *cpi) {
   int rdmult = cpi->td.mb.rdmult;
   for (int i = 0; i <= 3; i++) {
     if (i > max_signaling_bits) break;
-    int best_lev0[CDEF_MAX_STRENGTHS];
+    int best_lev0[CDEF_MAX_STRENGTHS] = { 0 };
     int best_lev1[CDEF_MAX_STRENGTHS] = { 0 };
     const int nb_strengths = 1 << i;
     uint64_t tot_mse;