[SCM] libav/experimental: 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.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:52:58 UTC 2013


The following commit has been merged in the experimental branch:
commit 7fd88069241ead2d2fd3e2db1b79e4b292e90001
Author: Ramiro Polla <ramiro.polla at gmail.com>
Date:   Fri Oct 16 16:10:00 2009 +0000

    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

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 8880395..3b0789d 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();
 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list