aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2009-10-16 16:10:00 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2009-10-16 16:10:00 +0000
commit7fd88069241ead2d2fd3e2db1b79e4b292e90001 (patch)
tree0260c2265981d1ae9b1dc58326b04cc763827c21
parent33815fa106853d031e633dd9df50d628da5592b2 (diff)
downloadffmpeg-7fd88069241ead2d2fd3e2db1b79e4b292e90001.tar.gz
mlp: Only initialize VLC tables once. This caused a crash when multiple
instances of the decoder were started at different times. Bug reported by Maxim Anisiutkin. Originally committed as revision 20254 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mlpdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 88803959bf..3b0789d054 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -155,6 +155,7 @@ static VLC huff_vlc[3];
static av_cold void init_static(void)
{
+ if (!huff_vlc[0].bits) {
INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
&ff_mlp_huffman_tables[0][0][1], 2, 1,
&ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
@@ -164,6 +165,7 @@ static av_cold void init_static(void)
INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
&ff_mlp_huffman_tables[2][0][1], 2, 1,
&ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
+ }
ff_mlp_init_crc();
}