[FFmpeg-cvslog] avcodec/vlc: add correct upper limit for recursive function

Paul B Mahol git at videolan.org
Mon Sep 18 21:07:10 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep 17 10:29:34 2023 +0200| [fa20f5cd9e131f22da06ef57bf5aedd87ff51a90] | committer: Paul B Mahol

avcodec/vlc: add correct upper limit for recursive function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa20f5cd9e131f22da06ef57bf5aedd87ff51a90
---

 libavcodec/vlc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list