[FFmpeg-cvslog] Add assert that the avcodec lock is held when initializing static VLC tables .

Reimar Döffinger git at videolan.org
Wed Dec 5 21:01:46 CET 2012


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Nov 27 21:58:22 2012 +0100| [dd154198b1afa9f3f740eb0b2ccd7ab665f8edd4] | committer: Reimar Döffinger

Add assert that the avcodec lock is held when initializing static VLC tables.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd154198b1afa9f3f740eb0b2ccd7ab665f8edd4
---

 libavcodec/bitstream.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index ce83ee0..e986300 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -30,6 +30,7 @@
 
 #include "libavutil/avassert.h"
 #include "avcodec.h"
+#include "internal.h"
 #include "mathops.h"
 #include "get_bits.h"
 #include "put_bits.h"
@@ -275,6 +276,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
         }else if(vlc->table_size){
             abort(); // fatal error, we are called on a partially initialized table
         }
+        av_assert0(ff_avcodec_locked);
     }else {
         vlc->table = NULL;
         vlc->table_allocated = 0;



More information about the ffmpeg-cvslog mailing list