Reorder condition to prevent indexing past the array

This commit is contained in:
Ari Lemmetti 2021-12-08 21:13:25 +02:00
parent e87b12dec1
commit bb1f2a0895

View file

@ -1366,7 +1366,7 @@ static void search_pu_inter_ref(inter_search_info_t *info,
double LX_bits[2] = { best_bits, best_bits };
// Compute costs and add entries for both lists, if necessary
for (; ref_list_active[ref_list] && ref_list < 2; ++ref_list) {
for (; ref_list < 2 && ref_list_active[ref_list]; ++ref_list) {
LX_idx = ref_list_idx[ref_list];
uint8_t mv_ref_coded = LX_idx;