Fix Valgrind warning in av1_pick_filter_restoration
Some array elements were defined and left uninitialised. This wasn't causing a
problem, as the elements were later ignored, but it did cause Valgrind to
produce warnings.
The function now initialises the full array immediately after its definition in
order to quiet these warnings.
BUG=aomedia:1244
Change-Id: I5083f1f4008cb3ab70a4af4d1d2573dee8793303
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index bc32c60..87f1246 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -1157,6 +1157,13 @@
RestUnitSearchInfo *rusi =
(RestUnitSearchInfo *)aom_memalign(16, sizeof(*rusi) * ntiles[0]);
+ // If the restoration unit dimensions are not multiples of
+ // rsi->restoration_unit_size then some elements of the rusi array may be
+ // left uninitialised when we reach copy_unit_info(...). This is not a
+ // problem, as these elements are ignored later, but in order to quiet
+ // Valgrind's warnings we initialise the array below.
+ memset(rusi, 0, sizeof(*rusi) * ntiles[0]);
+
RestSearchCtxt rsc;
for (int plane = AOM_PLANE_Y; plane <= AOM_PLANE_V; ++plane) {
init_rsc(src, &cpi->common, &cpi->td.mb, plane, rusi, &cpi->trial_frame_rst,