From c2265ecbb240d7a97c4af65878271f8aad22b316 Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Mon, 30 Oct 2023 01:12:26 +0100 Subject: [PATCH] Fix potential index out of bounds --- src/coding/circus_decoder_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coding/circus_decoder_lib.c b/src/coding/circus_decoder_lib.c index e0c8a1fb..a9e108f8 100644 --- a/src/coding/circus_decoder_lib.c +++ b/src/coding/circus_decoder_lib.c @@ -330,7 +330,7 @@ circus_handle_t* circus_init(off_t start, uint8_t codec, uint8_t flags) { handle->flags = flags; //(config >> 8) & 0xFF; scale_index = (handle->flags & 0xF); - if (scale_index > 5) goto fail; + if (scale_index >= 5) goto fail; handle->scales = scale_table[scale_index]; if (handle->codec == XPCM_CODEC_VQ_DEFLATE) {