aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-09-17 10:29:34 +0200
committerPaul B Mahol <onemda@gmail.com>2023-09-18 20:11:48 +0200
commitfa20f5cd9e131f22da06ef57bf5aedd87ff51a90 (patch)
tree3be58a683c2c3d39fd029be4462f669aaa978556
parentba9cd06c763648ecd1f447d7a672a0da85749d30 (diff)
downloadffmpeg-fa20f5cd9e131f22da06ef57bf5aedd87ff51a90.tar.gz
avcodec/vlc: add correct upper limit for recursive function
-rw-r--r--libavcodec/vlc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c
index b353d2e86c..3b66c94354 100644
--- a/libavcodec/vlc.c
+++ b/libavcodec/vlc.c
@@ -419,7 +419,7 @@ static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single,
}
add_level(table, nb_elems, nb_codes, numbits, buf,
- 0, 0, numbits, 0, minbits, max, count, &info);
+ 0, 0, FFMIN(maxbits, numbits), 0, minbits, max, count, &info);
av_log(NULL, AV_LOG_DEBUG, "Joint: %d/%d/%d/%d/%d codes min=%ubits max=%u\n",
count[0], count[1], count[2], count[3], count[4], minbits, max);