Commit b08544de authored by Imdad Sardharwalla's avatar Imdad Sardharwalla Committed by Debargha Mukherjee

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
parent ffa57594
......@@ -1157,6 +1157,13 @@ void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *src, AV1_COMP *cpi) {
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment