From c9af8f80f7976a7694c710f1426d816a67364a56 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sun, 26 Nov 2023 03:16:34 -0500 Subject: Fix potential read out of bounds in fargan --- dnn/fargan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnn/fargan.c b/dnn/fargan.c index 58115fe3..451fcacb 100644 --- a/dnn/fargan.c +++ b/dnn/fargan.c @@ -50,7 +50,7 @@ static void compute_fargan_cond(FARGANState *st, float *cond, const float *featu celt_assert(FARGAN_FEATURES+COND_NET_PEMBED_OUT_SIZE == model->cond_net_fdense1.nb_inputs); celt_assert(COND_NET_FCONV1_IN_SIZE == model->cond_net_fdense1.nb_outputs); celt_assert(COND_NET_FCONV1_OUT_SIZE == model->cond_net_fconv1.nb_outputs); - OPUS_COPY(&dense_in[NB_FEATURES], &model->cond_net_pembed.float_weights[IMAX(0,IMIN(period-32, 224))*COND_NET_PEMBED_OUT_SIZE], COND_NET_PEMBED_OUT_SIZE); + OPUS_COPY(&dense_in[NB_FEATURES], &model->cond_net_pembed.float_weights[IMAX(0,IMIN(period-32, 223))*COND_NET_PEMBED_OUT_SIZE], COND_NET_PEMBED_OUT_SIZE); OPUS_COPY(dense_in, features, NB_FEATURES); compute_generic_dense(&model->cond_net_fdense1, conv1_in, dense_in, ACTIVATION_TANH, st->arch); -- cgit v1.2.3