From 8f04988e463f17d58ba5a52f09cf49231037bb6c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 8 Dec 2020 22:38:05 +0100 Subject: avcodec/rl: Allow to create only a few VLC tables It is not uncommon that only the first one is used; this is similar to ff_init_2d_vlc_rl(). Signed-off-by: Andreas Rheinhardt --- libavcodec/rl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/rl.c') diff --git a/libavcodec/rl.c b/libavcodec/rl.c index c532b5bf56..93153ff723 100644 --- a/libavcodec/rl.c +++ b/libavcodec/rl.c @@ -80,6 +80,9 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size) int qmul = q * 2; int qadd = (q - 1) | 1; + if (!rl->rl_vlc[q]) + return; + if (q == 0) { qmul = 1; qadd = 0; -- cgit v1.2.3