diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-09-27 19:13:58 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-09-27 19:18:32 +0200 |
commit | b23eaf968e375f2d38865d90a788221caead3324 (patch) | |
tree | 76fd85b5c949f9ce8c025a099d5ec1b351f77628 /libavcodec/vlc.c | |
parent | 58b6c0c327ab9b49e177694ac02fd8d782e20a4a (diff) | |
download | ffmpeg-b23eaf968e375f2d38865d90a788221caead3324.tar.gz |
avcodec/vlc: fix off by one in limit check for multi
Diffstat (limited to 'libavcodec/vlc.c')
-rw-r--r-- | libavcodec/vlc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c index 21b9fffe27..e4bbf2945e 100644 --- a/libavcodec/vlc.c +++ b/libavcodec/vlc.c @@ -368,7 +368,7 @@ static void add_level(VLC_MULTI_ELEM *table, const int nb_elems, uint32_t code; sym = buf[t].symbol; - if (l > curlimit) + if (l >= curlimit) return; code = curcode + (buf[t].code >> curlen); newlimit = curlimit - l; @@ -401,7 +401,7 @@ static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single, { int minbits, maxbits, max = nb_codes-1; unsigned count[VLC_MULTI_MAX_SYMBOLS-1] = { 0, }; - VLC_MULTI_ELEM info = { { 0, }, 0, }; + VLC_MULTI_ELEM info = { { 0, }, 0, 0, }; minbits = buf[0].bits; maxbits = buf[0].bits; |