Commit 156c385b authored by ramiro's avatar ramiro

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20254 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 660aa293
...@@ -155,6 +155,7 @@ static VLC huff_vlc[3]; ...@@ -155,6 +155,7 @@ static VLC huff_vlc[3];
static av_cold void init_static(void) static av_cold void init_static(void)
{ {
if (!huff_vlc[0].bits) {
INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18, INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
&ff_mlp_huffman_tables[0][0][1], 2, 1, &ff_mlp_huffman_tables[0][0][1], 2, 1,
&ff_mlp_huffman_tables[0][0][0], 2, 1, 512); &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
...@@ -164,6 +165,7 @@ static av_cold void init_static(void) ...@@ -164,6 +165,7 @@ static av_cold void init_static(void)
INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15, INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
&ff_mlp_huffman_tables[2][0][1], 2, 1, &ff_mlp_huffman_tables[2][0][1], 2, 1,
&ff_mlp_huffman_tables[2][0][0], 2, 1, 512); &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
}
ff_mlp_init_crc(); ff_mlp_init_crc();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment