Prevent using uninitialized memory

This commit is contained in:
Ari Lemmetti 2021-12-10 00:21:58 +02:00
parent e45c6a9c68
commit 2424a976a4

View file

@ -1759,7 +1759,10 @@ static void search_pu_inter(encoder_state_t * const state,
kvz_sort_keys_by_cost(&amvp[0]);
kvz_sort_keys_by_cost(&amvp[1]);
int best_keys[2] = { amvp[0].keys[0], amvp[1].keys[0] };
int best_keys[2] = {
amvp[0].size > 0 ? amvp[0].keys[0] : 0,
amvp[1].size > 0 ? amvp[1].keys[0] : 0
};
cu_info_t *best_unipred[2] = {
&amvp[0].unit[best_keys[0]],