]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpeg12enc: Always initialize MPEG-2 intra VLC table lengths
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 24 Nov 2020 12:29:29 +0000 (13:29 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 25 Nov 2020 00:01:05 +0000 (01:01 +0100)
The MPEG-1/2 encoders initialize several tables once during the first
time one of the encoders is initialized; the table for MPEG-2 intra VLC
lengths is only initialized if it is used for this encoder instance.
This implies that if the first MPEG-1/2 encoder to be initialized does
not use it, it will never be initialized even if a later encoder
instance makes use of them. Fix this by initializing this table
unconditionally.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpeg12enc.c

index 46c3424de9b89d385fec2c915a812934599e6e16..eee4af0adcff30c2b66ae3f8df23011647c52cec 100644 (file)
@@ -1055,7 +1055,6 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s)
         }
 
         init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len);
-        if (s->intra_vlc_format)
             init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len);
 
         /* build unified dc encoding tables */