From e8ef0d2b28e7ee7b7cc65ed0b94a280c553f05a0 Mon Sep 17 00:00:00 2001 From: siivonek Date: Fri, 4 Feb 2022 14:41:57 +0200 Subject: [PATCH] [mip] Fix undefined behaviour error in CI test. --- src/intra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intra.c b/src/intra.c index 6ae57361..79c4d639 100644 --- a/src/intra.c +++ b/src/intra.c @@ -761,9 +761,9 @@ void kvz_mip_predict(encoder_state_t const* const state, kvz_intra_references* c int ref_samples_top[INTRA_REF_LENGTH]; int ref_samples_left[INTRA_REF_LENGTH]; - for (int i = 0; i < INTRA_REF_LENGTH; i++) { - ref_samples_top[i] = (int)refs->ref.top[i+1]; // NOTE: in VTM code these are indexed as x + 1 & y + 1 during init - ref_samples_left[i] = (int)refs->ref.left[i+1]; + for (int i = 1; i < INTRA_REF_LENGTH; i++) { + ref_samples_top[i-1] = (int)refs->ref.top[i]; // NOTE: in VTM code these are indexed as x + 1 & y + 1 during init + ref_samples_left[i-1] = (int)refs->ref.left[i]; } // Compute reduced boundary with Haar-downsampling