From b8593a2bd856478fe5004b2b1e32d8bde4145b3a Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 15 Jun 2024 11:02:57 +0200 Subject: [PATCH] avutil/intmath: fix possible array overread --- libavutil/intmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/intmath.h b/libavutil/intmath.h index 52e11a8d5f..856bbbcda2 100644 --- a/libavutil/intmath.h +++ b/libavutil/intmath.h @@ -75,7 +75,7 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v) v >>= 8; n += 8; } - n += ff_log2_tab[v]; + n += ff_log2_tab[v & 0xff]; return n; }